New patches: [unrevert anon**20130901141922 Ignore-this: a6d3f34d1b62f45e8001627436c48c6d ] { hunk ./tests/TestUUID.hs 12 import qualified Data.UUID.V1 as U import qualified Data.UUID.V3 as U3 import qualified Data.UUID.V5 as U5 -import Test.HUnit +import qualified Test.HUnit as H +import Test.HUnit hiding (Test) import Test.QuickCheck hiding ((.&.)) hunk ./tests/TestUUID.hs 15 +import Test.Framework (defaultMain, Test(..)) +import Test.Framework.Providers.HUnit (hUnitTestToTests) +import Test.Framework.Providers.QuickCheck2 (testProperty) import System.IO hunk ./tests/TestUUID.hs 34 arbitrary = choose (U.nil, U.nil) -test_null :: Test -test_null = TestList [ +test_null :: H.Test +test_null = H.TestList [ "nil is null" ~: assertBool "" (U.null U.nil), "namespaceDNS is not null" ~: assertBool "" (not $ U.null U3.namespaceDNS) ] hunk ./tests/TestUUID.hs 40 -test_nil :: Test -test_nil = TestList [ +test_nil :: H.Test +test_nil = H.TestList [ "nil string" ~: U.toString U.nil @?= "00000000-0000-0000-0000-000000000000", "nil bytes" ~: U.toByteString U.nil @?= B.pack (replicate 16 0) ] hunk ./tests/TestUUID.hs 46 -test_conv :: Test -test_conv = TestList [ +test_conv :: H.Test +test_conv = H.TestList [ "conv bytes to string" ~: maybe "" (U.toString) (U.fromByteString b16) @?= s16, "conv string to bytes" ~: hunk ./tests/TestUUID.hs 56 where b16 = B.pack [1..16] s16 = "01020304-0506-0708-090a-0b0c0d0e0f10" -test_v1 :: [Maybe U.UUID] -> Test -test_v1 v1s = TestList [ +test_v1 :: [Maybe U.UUID] -> H.Test +test_v1 v1s = H.TestList [ "V1 unique" ~: nub (v1s \\ nub v1s) @?= [], hunk ./tests/TestUUID.hs 59 - "V1 not null" ~: TestList $ map (testUUID (not . U.null)) v1s, - "V1 valid" ~: TestList $ map (testUUID (isValidVersion 1)) v1s + "V1 not null" ~: H.TestList $ map (testUUID (not . U.null)) v1s, + "V1 valid" ~: H.TestList $ map (testUUID (isValidVersion 1)) v1s ] hunk ./tests/TestUUID.hs 62 - where testUUID :: (U.UUID -> Bool) -> Maybe U.UUID -> Test + where testUUID :: (U.UUID -> Bool) -> Maybe U.UUID -> H.Test testUUID p u = maybe False p u ~? show u hunk ./tests/TestUUID.hs 65 -test_v3 :: Test -test_v3 = TestList [ +test_v3 :: H.Test +test_v3 = H.TestList [ "V3 computation" ~: U3.generateNamed U3.namespaceDNS name @?= uV3 ] hunk ./tests/TestUUID.hs 73 where name = map (fromIntegral . ord) "www.widgets.com" :: [Word8] uV3 = fromJust $ U.fromString "3d813cbb-47fb-32ba-91df-831e1593ac29" -test_v5 :: Test -test_v5 = TestList [ +test_v5 :: H.Test +test_v5 = H.TestList [ "V5 computation" ~: U5.generateNamed U5.namespaceDNS name @?= uV5 ] hunk ./tests/TestUUID.hs 81 where name = map (fromIntegral . ord) "www.widgets.com" :: [Word8] uV5 = fromJust $ U.fromString "21f7f8de-8051-5b89-8680-0195ef798b6a" -prop_stringRoundTrip :: Property -prop_stringRoundTrip = label "String round trip" stringRoundTrip +prop_stringRoundTrip :: Test +prop_stringRoundTrip = testProperty "String round trip" stringRoundTrip where stringRoundTrip :: U.UUID -> Bool stringRoundTrip u = maybe False (== u) $ U.fromString (U.toString u) hunk ./tests/TestUUID.hs 86 -prop_byteStringRoundTrip :: Property -prop_byteStringRoundTrip = label "ByteString round trip" byteStringRoundTrip +prop_byteStringRoundTrip :: Test +prop_byteStringRoundTrip = testProperty "ByteString round trip" byteStringRoundTrip where byteStringRoundTrip :: U.UUID -> Bool byteStringRoundTrip u = maybe False (== u) $ U.fromByteString (U.toByteString u) hunk ./tests/TestUUID.hs 92 -prop_stringLength :: Property -prop_stringLength = label "String length" stringLength +prop_stringLength :: Test +prop_stringLength = testProperty "String length" stringLength where stringLength :: U.UUID -> Bool stringLength u = length (U.toString u) == 36 hunk ./tests/TestUUID.hs 97 -prop_byteStringLength :: Property -prop_byteStringLength = label "ByteString length" byteStringLength +prop_byteStringLength :: Test +prop_byteStringLength = testProperty "ByteString length" byteStringLength where byteStringLength :: U.UUID -> Bool byteStringLength u = B.length (U.toByteString u) == 16 hunk ./tests/TestUUID.hs 102 -prop_randomsDiffer :: Property -prop_randomsDiffer = label "Randoms differ" randomsDiffer +prop_randomsDiffer :: Test +prop_randomsDiffer = testProperty "Randoms differ" randomsDiffer where randomsDiffer :: (U.UUID, U.UUID) -> Bool randomsDiffer (u1, u2) = u1 /= u2 hunk ./tests/TestUUID.hs 107 -prop_randomNotNull :: Property -prop_randomNotNull = label "Random not null" randomNotNull +prop_randomNotNull :: Test +prop_randomNotNull = testProperty "Random not null" randomNotNull where randomNotNull :: U.UUID -> Bool randomNotNull = not. U.null hunk ./tests/TestUUID.hs 112 -prop_randomsValid :: Property -prop_randomsValid = label "Random valid" randomsValid +prop_randomsValid :: Test +prop_randomsValid = testProperty "Random valid" randomsValid where randomsValid :: U.UUID -> Bool randomsValid = isValidVersion 4 hunk ./tests/TestUUID.hs 117 -prop_v3NotNull :: Property -prop_v3NotNull = label "V3 not null" v3NotNull +prop_v3NotNull :: Test +prop_v3NotNull = testProperty "V3 not null" v3NotNull where v3NotNull :: [Word8] -> Bool v3NotNull = not . U.null . U3.generateNamed U3.namespaceDNS hunk ./tests/TestUUID.hs 122 -prop_v3Valid :: Property -prop_v3Valid = label "V3 valid" v3Valid +prop_v3Valid :: Test +prop_v3Valid = testProperty "V3 valid" v3Valid where v3Valid :: [Word8] -> Bool v3Valid = isValidVersion 3 . U3.generateNamed U3.namespaceDNS hunk ./tests/TestUUID.hs 127 -prop_v5NotNull :: Property -prop_v5NotNull = label "V5 not null" v5NotNull +prop_v5NotNull :: Test +prop_v5NotNull = testProperty "V5 not null" v5NotNull where v5NotNull :: [Word8] -> Bool v5NotNull = not . U.null . U5.generateNamed U5.namespaceDNS hunk ./tests/TestUUID.hs 132 -prop_v5Valid :: Property -prop_v5Valid = label "V5 valid" v5Valid +prop_v5Valid :: Test +prop_v5Valid = testProperty "V5 valid" v5Valid where v5Valid :: [Word8] -> Bool v5Valid = isValidVersion 5 . U5.generateNamed U5.namespaceDNS hunk ./tests/TestUUID.hs 137 -prop_readShowRoundTrip :: Property -prop_readShowRoundTrip = label "Read/Show round-trip" prop +prop_readShowRoundTrip :: Test +prop_readShowRoundTrip = testProperty "Read/Show round-trip" prop where -- we're using 'Maybe UUID' to add a bit of -- real-world complexity. prop :: U.UUID -> Bool hunk ./tests/TestUUID.hs 147 main :: IO () main = do v1s <- replicateM 100 U.nextUUID - _ <- runTestText (putTextToHandle stderr False) (TestList [ + defaultMain $ + concat $ + [ hUnitTestToTests $ H.TestList [ test_null, test_nil, test_conv, hunk ./tests/TestUUID.hs 156 test_v1 v1s, test_v3, test_v5 - ]) - mapM_ quickCheck $ [ - prop_stringRoundTrip, - prop_readShowRoundTrip, - prop_byteStringRoundTrip, - prop_stringLength, - prop_byteStringLength, - prop_randomsDiffer, - prop_randomNotNull, - prop_randomsValid, - prop_v3NotNull, - prop_v3Valid, - prop_v5NotNull, - prop_v5Valid + ] + , [ prop_stringRoundTrip, + prop_readShowRoundTrip, + prop_byteStringRoundTrip, + prop_stringLength, + prop_byteStringLength, + prop_randomsDiffer, + prop_randomNotNull, + prop_randomsValid, + prop_v3NotNull, + prop_v3Valid, + prop_v5NotNull, + prop_v5Valid + ] ] hunk ./uuid.cabal 83 bytestring >= 0.9 && < 1.1, HUnit >=1.2 && < 1.3, QuickCheck >=2.4 && < 2.7, - random >= 1.0.1 && < 1.1 + random >= 1.0.1 && < 1.1, + test-framework == 0.8.*, + test-framework-hunit == 0.3.*, + test-framework-quickcheck2 == 0.3.* } Context: [bump version Antoine Latter **20130901132718 Ignore-this: 52dde275b2c0f7d37b34f2ac0eb0bf19 ] [Update 'cryptohash' dependency Antoine Latter **20130901132631 Ignore-this: 905f9ec59a0bec12307c8d9e3120a7d9 ] [TAG 1.2.13 Antoine Latter **20130512200439 Ignore-this: 740725069670fa015ed0f458fed75d58 ] Patch bundle hash: 1bc3790b3eee140f9c0daca5ba5122745ef1f008