chore: pandoc test stub

This commit is contained in:
Sarah Vaupel 2022-07-14 17:57:08 +02:00
parent 957bf4c966
commit ac78edd99c

27
test/PandocSpec.hs Normal file
View File

@ -0,0 +1,27 @@
module PandocSpec where
import TestImport
import Utils.Print
import qualified Data.Map.Lazy as Map
import Text.Pandoc
import Text.Pandoc.Arbitrary
spec :: Spec
spec = describe "addMeta" $ do
it "should overwrite existing settings" $ do
metaOverwrite <- arbitrary
pd <- arbitrary
let (Pandoc newMeta _) = addMeta metaOverwrite pd
Map.toList newMeta `shouldContain` Map.toList metaOverwrite
it "should preserve untouched settings" $ do
metaOverwrite <- arbitrary
pd <- arbitrary
let
(Pandoc keptMeta _) = pd
(Pandoc newMeta _) = addMeta metaOverwrite pd
Map.toList newMeta `shouldContain` Map.toList (keptMeta `Map.difference` metaOverwrite)