genvalidity-hspec-hashable 1.0.0.0 → 1.0.0.1
raw patch · 3 files changed
+23/−18 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- genvalidity-hspec-hashable.cabal +2/−2
- src/Test/Validity/Hashable.hs +17/−16
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +## [1.0.0.1] - 2023-10-04++* Compatibility with `hashable >= 1.4`+ ## [1.0.0.0] - 2021-11-20 * Compatibility with `genvalidity >= 1.0.0.0`
genvalidity-hspec-hashable.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: genvalidity-hspec-hashable-version: 1.0.0.0+version: 1.0.0.1 synopsis: Standard spec's for Hashable instances description: Standard spec's for Hashable instances category: Testing
src/Test/Validity/Hashable.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-}+{-# OPTIONS_GHC -Wno-redundant-constraints #-} -- | Hashable properties --@@ -71,19 +72,19 @@ parallel $ do let name = nameOf @a hashablestr = unwords ["hashWithSalt :: Int ->", name, "-> Int"]- describe ("Hashable " ++ name) $- describe hashablestr $- it- ( unwords- [ "satisfies (a == b) => (hashWithSalt n a) ==",- "(hashWithSalt n b), for every n and for",- genname,- name- ]- )- $ let ss (a, b) = (,) <$> s a <*> s b- in forAllShrink gen ss $ \(a1, a2) ->- forAllValid $ \int ->- when (a1 == a2) $- let h = hashWithSalt int- in h a1 `shouldBe` h a2+ describe ("Hashable " ++ name)+ $ describe hashablestr+ $ it+ ( unwords+ [ "satisfies (a == b) => (hashWithSalt n a) ==",+ "(hashWithSalt n b), for every n and for",+ genname,+ name+ ]+ )+ $ let ss (a, b) = (,) <$> s a <*> s b+ in forAllShrink gen ss $ \(a1, a2) ->+ forAllValid $ \int ->+ when (a1 == a2) $+ let h = hashWithSalt int+ in h a1 `shouldBe` h a2