uuid 1.3.7 → 1.3.8
raw patch · 3 files changed
+39/−3 lines, 3 filesdep ~deepseq
Dependency ranges changed: deepseq
Files
- CHANGES +4/−0
- tests/TestUUID.hs +33/−1
- uuid.cabal +2/−2
CHANGES view
@@ -1,3 +1,7 @@+1.3.8++- Allow building against newer deepseq.+ 1.3.7 - Allow building against newer time.
tests/TestUUID.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} import Control.Monad (replicateM) import Data.Bits@@ -82,6 +83,22 @@ where name = map (fromIntegral . ord) "www.widgets.com" :: [Word8] uV5 = fromJust $ U.fromString "21f7f8de-8051-5b89-8680-0195ef798b6a" ++-- | Test fromByteString with a fixed-input.+test_fromByteString :: H.Test+test_fromByteString =+ "UUID fromByteString" ~:+ Just inputUUID @=? U.fromByteString "\165\202\133f\217\197H5\153\200\225\241>s\181\226"++-- | Test fromWords with a fixed-input+test_fromWords :: H.Test+test_fromWords =+ "UUID fromWords" ~:+ inputUUID @=? U.fromWords 2781513062 3653584949 2580079089 1047770594++inputUUID :: U.UUID+inputUUID = read "a5ca8566-d9c5-4835-99c8-e1f13e73b5e2"+ prop_stringRoundTrip :: Test prop_stringRoundTrip = testProperty "String round trip" stringRoundTrip where stringRoundTrip :: U.UUID -> Bool@@ -168,6 +185,17 @@ toASCIIBytes_fromASCIIBytes uuid = Just uuid == U.fromASCIIBytes (U.toASCIIBytes uuid) +toWords_fromWords :: U.UUID -> Bool+toWords_fromWords uuid =+ uuid == myUncurry4 U.fromWords (U.toWords uuid)++fromWords_toWords :: (Word32, Word32, Word32, Word32) -> Bool+fromWords_toWords wds =+ wds == U.toWords (myUncurry4 U.fromWords wds)++myUncurry4 :: (x1 -> x2 -> x3 -> x4 -> y) -> (x1, x2, x3, x4) -> y+myUncurry4 f (a,b,c,d) = f a b c d+ prop_storableRoundTrip :: Test prop_storableRoundTrip = testProperty "Storeable round-trip" $ unsafePerformIO . prop@@ -190,7 +218,9 @@ test_conv, test_v1 v1s, test_v3,- test_v5+ test_v5,+ test_fromByteString,+ test_fromWords ] , [ prop_stringRoundTrip, prop_readShowRoundTrip,@@ -211,5 +241,7 @@ , testProperty "fromASCIIBytes_toString" toASCIIBytes_toString , testProperty "fromASCIIBytes_toASCIIBytes" fromASCIIBytes_toASCIIBytes , testProperty "toASCIIBytes_fromASCIIBytes" toASCIIBytes_fromASCIIBytes+ , testProperty "toWords_fromWords" toWords_fromWords+ , testProperty "fromWords_toWords" fromWords_toWords ] ]
uuid.cabal view
@@ -1,5 +1,5 @@ Name: uuid-Version: 1.3.7+Version: 1.3.8 Copyright: (c) 2008-2014 Antoine Latter Author: Antoine Latter Maintainer: aslatter@gmail.com@@ -30,7 +30,7 @@ binary >= 0.4 && < 0.8, bytestring >= 0.9 && < 1.1, cryptohash >= 0.7 && < 0.12,- deepseq == 1.3.*,+ deepseq >= 1.3 && < 1.5, hashable (>= 1.1.1.0 && < 1.2.0) || (>= 1.2.1 && < 1.3), network-info == 0.2.*, random >= 1.0.1 && < 1.2,