Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some idempotence tests

  • Loading branch information...
commit c58ced355e4c5d1d13b5efcd4084c98dbe97a217 1 parent 68f4577
@bytbox authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 test.hs
View
16 test.hs
@@ -4,14 +4,16 @@ import System.Exit (exitSuccess, exitFailure)
import Test.QuickCheck
import Text.Format
-prop_id :: Int -> Bool
-prop_id = const True
+prop_render_raw_idempotent :: String -> Bool
+prop_render_raw_idempotent s =
+ let r = renderFormatString "$a" (\_ -> Just s) in
+ r == Right s
+prop_scan_raw_idempotent s =
+ let r = scanFormatString "$a" s in
+ r == Right [("a", s)]
-prop_id' :: Int -> Bool
-prop_id' = const False
-
-tests = [ ("Good", prop_id)
- , ("Bad", prop_id')
+tests = [ ("RenderRawIdempotent", prop_render_raw_idempotent)
+ , ("ScanRawIdempotent", prop_scan_raw_idempotent)
]
isSuccess (Success _ _ _) = True
Please sign in to comment.
Something went wrong with that request. Please try again.