chore: pandoc test stub
This commit is contained in:
parent
957bf4c966
commit
ac78edd99c
27
test/PandocSpec.hs
Normal file
27
test/PandocSpec.hs
Normal 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)
|
||||||
Reference in New Issue
Block a user