cityhash 0.0.1 → 0.0.2
raw patch · 3 files changed
+42/−5 lines, 3 filesdep +QuickCheckdep +cityhashdep +test-frameworkPVP ok
version bump matches the API change (PVP)
Dependencies added: QuickCheck, cityhash, test-framework, test-framework-quickcheck2
API changes (from Hackage documentation)
Files
- Data/Digest/CityHash.hs +3/−3
- cityhash.cabal +18/−2
- tests/Properties.hs +21/−0
Data/Digest/CityHash.hs view
@@ -14,9 +14,9 @@ -- and 128-bit interfaces. -- -- Note that CityHash is designed to work on architectures where--- unaligned reads have a small penalty. In practice it is only used--- at Google on little-endian Intel/AMD CPUs it seems, and has not--- been tested on big-endian architectures.+-- unaligned reads do not have a large penalty. In practice it is only+-- used at Google on little-endian Intel/AMD CPUs it seems, and has+-- not been tested on big-endian architectures. -- module Data.Digest.CityHash ( -- * Hashing values
cityhash.cabal view
@@ -1,5 +1,5 @@ name: cityhash-version: 0.0.1+version: 0.0.2 synopsis: bindings to Google CityHash description: This package implements a binding to the google CityHash family of hashing functions.@@ -17,7 +17,7 @@ extra-source-files: cbits/city.cc, cbits/city.h, cbits/hs_city.cc, cbits/hs_city.h,- README.md+ README.md, tests/Properties.hs source-repository head type: git@@ -34,4 +34,20 @@ extra-libraries: stdc++ ghc-options: -Wall -O2 -fwarn-tabs+ default-language: Haskell98++test-suite properties+ hs-source-dirs: tests+ main-is: Properties.hs+ type: exitcode-stdio-1.0++ build-depends:+ base >= 3 && < 5,+ bytestring == 0.9.*,+ QuickCheck == 2.4.*,+ test-framework == 0.3.*,+ test-framework-quickcheck2 == 0.2.*,+ cityhash++ ghc-options: -fno-cse default-language: Haskell98
+ tests/Properties.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE ViewPatterns #-}+module Main (main) where++import qualified Data.ByteString as S+import Data.Digest.CityHash++import Test.Framework (defaultMain, testGroup)+import Test.Framework.Providers.QuickCheck2 (testProperty)++main :: IO ()+main = defaultMain [ testGroup "simple" [+ testProperty "cityhash64 is pure" prop_city64_pure+ , testProperty "cityhash128 is pure" prop_city128_pure+ ]+ ]++prop_city64_pure (S.pack -> xs)+ = cityHash64 xs == cityHash64 xs++prop_city128_pure (S.pack -> xs)+ = cityHash128 xs == cityHash128 xs