From 41ebdee5df4b322ce49ee955824047a7e4d888f9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 7 Apr 2017 21:04:22 +0200 Subject: Lua filter: improve doc filter performance Pandoc elements are pushed and pulled from the lua stack via custom instances. --- test/Tests/Lua.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.3