From ac78edd99c9d515b51964fd6824101f25feeb7da Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 14 Jul 2022 17:57:08 +0200 Subject: [PATCH] chore: pandoc test stub --- test/PandocSpec.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/PandocSpec.hs diff --git a/test/PandocSpec.hs b/test/PandocSpec.hs new file mode 100644 index 000000000..ba43aeda5 --- /dev/null +++ b/test/PandocSpec.hs @@ -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)