From 209b300d6adeb2427c0058b808945ac39f851b24 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 22 Jan 2011 12:18:59 -0800 Subject: Added 'property' in Tests.Helpers & some quickcheck tests. --- tests/Tests/Helpers.hs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/Tests/Helpers.hs') diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs index 028f93fe7..91243e1ce 100644 --- a/tests/Tests/Helpers.hs +++ b/tests/Tests/Helpers.hs @@ -1,17 +1,26 @@ {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, TemplateHaskell #-} -- Utility functions for the test suite. -module Tests.Helpers where +module Tests.Helpers ( lit + , test + , (=?>) + , property + , ToString(..) + , ToPandoc(..) + ) + where import Text.Pandoc.Definition import Text.Pandoc.Builder (Inlines, Blocks, doc, plain) import Test.Framework import Test.Framework.Providers.HUnit -import Test.HUnit hiding (Test) +import Test.Framework.Providers.QuickCheck2 +import Test.HUnit (assertBool) import Text.Pandoc.Shared (normalize, defaultWriterOptions, WriterOptions(..), removeTrailingSpace) import Text.Pandoc.Writers.Native (writeNative) import Language.Haskell.TH.Quote +import qualified Test.QuickCheck.Property as QP lit :: QuasiQuoter lit = QuasiQuoter ((\a -> let b = rnl a in [|b|]) . filter (/= '\r')) $ @@ -37,6 +46,9 @@ test fn name (input, expected) = dashes x = '\n' : replicate (72 - length x - 5) '-' ++ " " ++ x ++ " ---\n" +property :: QP.Testable a => TestName -> a -> Test +property = testProperty + infix 6 =?> (=?>) :: a -> b -> (a,b) x =?> y = (x, y) -- cgit v1.2.3