refactor(pandoc): rewrite tests for pandoc applyMetas (2)
This commit is contained in:
parent
58cc35d118
commit
10e823b0c5
@ -15,10 +15,10 @@ import Text.Pandoc.Arbitrary ()
|
||||
|
||||
-- Instance Arbitrary Meta is somewhat useless, as it always generates the same 3 keys.
|
||||
newtype ArbitraryMeta = ArbitraryMeta { unArbitraryMeta :: Meta }
|
||||
deriving newtype (Eq, Ord, Semigroup, Monoid, Show, Read, Typable, Data, Generic)
|
||||
deriving newtype (Eq, Ord, Semigroup, Monoid, Show, Read, Typeable)
|
||||
|
||||
newtype ArbitraryPandoc = ArbitraryPandoc { unArbitraryPandoc :: Pandoc }
|
||||
deriving newtype (Eq, Ord, Show, Read, Typable, Data, Generic)
|
||||
deriving newtype (Eq, Ord, Show, Read, Typeable)
|
||||
|
||||
instance Arbitrary ArbitraryMeta where
|
||||
arbitrary = do
|
||||
@ -78,7 +78,7 @@ spec = do
|
||||
(abMetaOverwrite, apd) <- generate arbitrary
|
||||
let
|
||||
metaOverwrite = unArbitraryMeta abMetaOverwrite
|
||||
pd@(Pandoc metaOriginal _) = unArbitraryPandoc apd
|
||||
pd = unArbitraryPandoc apd
|
||||
(Pandoc newMeta _) = addMeta metaOverwrite pd
|
||||
(unMeta metaOverwrite `Map.isSubmapOf` unMeta newMeta) `shouldBe` True
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user