on master help sign in
add test for dropping spaces in 'read'
commit9e6e6b6bdc40c447095ab8de6120623d6469817c authorAntoine Latter <aslatter@gmail.com> dateThu 11 Aug 2011, 00:52 (15 years ago) parent1e1ae38
1 file changed+7
tests/TestUUID.hs+7
tests/TestUUID.hs+7
@@ -135,6 +135,12 @@ prop_v5Valid = label "V5 valid" v5Valid
135135 where v5Valid :: [Word8] -> Bool
136136 v5Valid = isValidVersion 5 . U5.generateNamed U5.namespaceDNS
137137
138+prop_readShowRoundTrip :: Property
139+prop_readShowRoundTrip = label "Read/Show round-trip" prop
140+ where -- we're using 'Maybe UUID' to add a bit of
141+ -- real-world complexity.
142+ prop :: U.UUID -> Bool
143+ prop uuid = read (show (Just uuid)) == Just uuid
138144
139145main :: IO ()
140146main = do
@@ -149,6 +155,7 @@ main = do
149155 ])
150156 mapM_ quickCheck $ [
151157 prop_stringRoundTrip,
158+ prop_readShowRoundTrip,
152159 prop_byteStringRoundTrip,
153160 prop_stringLength,
154161 prop_byteStringLength,