diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-07 21:04:22 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-07 21:04:22 +0200 |
commit | 41ebdee5df4b322ce49ee955824047a7e4d888f9 (patch) | |
tree | 7b1a87008aa9df7d8c5843fe6e21e815c21223c5 /test | |
parent | d412c38c714b810040d583bbe40af4937f8ef138 (diff) | |
download | pandoc-41ebdee5df4b322ce49ee955824047a7e4d888f9.tar.gz |
Lua filter: improve doc filter performance
Pandoc elements are pushed and pulled from the lua stack via custom
instances.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Lua.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index f01784663..64c35b298 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -7,7 +7,9 @@ import Test.Tasty (TestTree) import Test.Tasty.HUnit (Assertion, assertEqual, testCase) import Test.Tasty.QuickCheck (ioProperty, testProperty) import Text.Pandoc.Arbitrary () -import Text.Pandoc.Builder +import Text.Pandoc.Definition (Block, Inline, Meta, Pandoc) +import Text.Pandoc.Builder ( (<>), bulletList, doc, emph, linebreak, rawBlock + , para, plain, space, str, strong) import Text.Pandoc.Lua import qualified Scripting.Lua as Lua @@ -43,6 +45,12 @@ tests = , testProperty "block elements can be round-tripped through the lua stack" $ \x -> ioProperty (roundtripEqual (x::Block)) + + , testProperty "meta blocks can be round-tripped through the lua stack" $ + \x -> ioProperty (roundtripEqual (x::Meta)) + + , testProperty "documents can be round-tripped through the lua stack" $ + \x -> ioProperty (roundtripEqual (x::Pandoc)) ] assertFilterConversion :: String -> FilePath -> Pandoc -> Pandoc -> Assertion |