aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Writers/Native.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-07-26 08:37:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-07-26 08:37:36 -0700
commit45e4c123a45b83d666088967c25b91cf9bb5db72 (patch)
treeb3662354ccacd88b0d9238b3d0c049c4c876abc4 /tests/Tests/Writers/Native.hs
parent3053267280bfd7b255f3bf47480e4a8a97ec2915 (diff)
downloadpandoc-45e4c123a45b83d666088967c25b91cf9bb5db72.tar.gz
Moved tests to tests/, modified cabal file so lib isn't recompiled.
Diffstat (limited to 'tests/Tests/Writers/Native.hs')
-rw-r--r--tests/Tests/Writers/Native.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Tests/Writers/Native.hs b/tests/Tests/Writers/Native.hs
new file mode 100644
index 000000000..19740e0f4
--- /dev/null
+++ b/tests/Tests/Writers/Native.hs
@@ -0,0 +1,21 @@
+module Tests.Writers.Native (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Tests.Arbitrary()
+
+p_write_rt :: Pandoc -> Bool
+p_write_rt d =
+ read (writeNative defaultWriterOptions{ writerStandalone = True } d) == d
+
+p_write_blocks_rt :: [Block] -> Bool
+p_write_blocks_rt bs = length bs > 20 ||
+ read (writeNative defaultWriterOptions (Pandoc (Meta [] [] []) bs)) ==
+ bs
+
+tests :: [Test]
+tests = [ property "p_write_rt" p_write_rt
+ , property "p_write_blocks_rt" p_write_blocks_rt
+ ]