hashtables 1.4.0 → 1.4.1
raw patch · 8 files changed
+45/−42 lines, 8 filesdep +tastydep +tasty-hunitdep +tasty-quickcheckdep −HUnitdep −test-frameworkdep −test-framework-hunitPVP ok
version bump matches the API change (PVP)
Dependencies added: tasty, tasty-hunit, tasty-quickcheck
Dependencies removed: HUnit, test-framework, test-framework-hunit, test-framework-quickcheck2
API changes (from Hackage documentation)
Files
- cabal.project +3/−0
- cbits/common.c +2/−6
- cbits/default.c +1/−1
- changelog.md +16/−11
- hashtables.cabal +8/−8
- src/Data/HashTable/Internal/CacheLine.hs +7/−4
- test/suite/Data/HashTable/Test/Common.hs +6/−10
- test/suite/TestSuite.hs +2/−2
cabal.project view
@@ -3,3 +3,6 @@ tests: True test-show-details: direct++allow-newer:+ , *:base
cbits/common.c view
@@ -3,7 +3,7 @@ #ifdef WIN32 #include <windows.h> #else-#include <signal.h>+#include <stdlib.h> #include <unistd.h> #endif @@ -19,11 +19,7 @@ #endif if (*check) { printf("timeout expired, dying!!\n");-#ifdef WIN32- abort();-#else- raise(SIGKILL);-#endif+ exit(1); } }
cbits/default.c view
@@ -198,6 +198,6 @@ return line_result(m, start); } -void check_impl_specific(int* num_tests, int* num_errors) {+void check_impl_specific() { }
changelog.md view
@@ -1,31 +1,36 @@ # Hashtables changelog +## 1.4.1++ - Fix broken compile when compiling with `-fportable` flag.+ - Make it build with GHC WASM (Bodigrim).+ ## 1.4.0 -Replace deprecated Mutable Array function, which modifies the signature of the `length`-function and hence the API.-Support more recent compilers.+ - Replace deprecated Mutable Array function, which modifies the signature of the `length`+ function and hence the API.+ - Support more recent compilers. ## 1.3.1 -Fix Noncanonical mappend definition warning.-Support more recent compilers.+ - Fix Noncanonical mappend definition warning.+ - Support more recent compilers. ## 1.3 -Support Hashable 1.4. This new version of Hashable drops the Eq constraint, so the Eq constraint-needs to be dropped in the SPECIALIZE statements in Hashtables.+ - Support Hashable 1.4. This new version of Hashable drops the Eq constraint, so the Eq constraint+ needs to be dropped in the SPECIALIZE statements in Hashtables. ## 1.2.4.2 -Cabal file: add missing other-modules-Silence import warnings. Know that we require ghc >= 7.8.-Fix build with GHC 9.2+ - Cabal file: add missing other-modules+ - Silence import warnings. Know that we require ghc >= 7.8.+ - Fix build with GHC 9.2 ## 1.2.4.1 -Update some test suite dep upper bounds.+ - Update some test suite dep upper bounds. ## 1.2.4.0
hashtables.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: 2.2 Name: hashtables-Version: 1.4.0+Version: 1.4.1 Synopsis: Mutable hash tables in the ST monad Homepage: http://github.com/gregorycollins/hashtables License: BSD-3-Clause@@ -277,10 +277,9 @@ mwc-random >= 0.8 && <0.16, primitive, QuickCheck >= 2.3.0.2,- HUnit >= 1.2 && <2,- test-framework >= 0.3.1 && <0.9,- test-framework-quickcheck2 >= 0.2.6 && <0.4,- test-framework-hunit >= 0.2.6 && <3,+ tasty >= 1.4 && <= 1.6,+ tasty-quickcheck >= 0.10 && <0.12,+ tasty-hunit >= 0.10 && <0.11, vector >= 0.7 cpp-options: -DTESTSUITE@@ -290,11 +289,12 @@ if impl(ghc >= 6.12.0) ghc-options: -Wall -fwarn-tabs -funbox-strict-fields- -fno-warn-unused-do-bind -threaded+ -fno-warn-unused-do-bind else- ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -threaded-+ ghc-options: -Wall -fwarn-tabs -funbox-strict-fields + if !arch(wasm32)+ ghc-options: -threaded source-repository head type: git
src/Data/HashTable/Internal/CacheLine.hs view
@@ -251,9 +251,12 @@ 27# !idx = I# (word2Int# idxW#) !(I8# pos8#) = U.unsafeIndex deBruijnBitPositions idx+#if __GLASGOW_HASKELL__ >= 900+ !posw# = int2Word# (int8ToInt# pos8#)+#else !posw# = int2Word# pos8#- #endif+#endif #ifdef NO_C_SEARCH@@ -745,7 +748,7 @@ -- \"-1\" if not found cacheLineSearch !vec !start !value = do #ifdef NO_C_SEARCH- let !vlen = M.length vec+ vlen <- M.length vec let !st1 = vlen - start let !nvlen = numElemsInCacheLine - st1 let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask@@ -776,7 +779,7 @@ -- \"-1\" if not found cacheLineSearch2 !vec !start !value !value2 = do #ifdef NO_C_SEARCH- let !vlen = M.length vec+ !vlen <- M.length vec let !st1 = vlen - start let !nvlen = numElemsInCacheLine - st1 let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask@@ -807,7 +810,7 @@ -- \"-1\" if not found cacheLineSearch3 !vec !start !value !value2 !value3 = do #ifdef NO_C_SEARCH- let !vlen = M.length vec+ !vlen <- M.length vec let !st1 = vlen - start let !nvlen = numElemsInCacheLine - st1 let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask
test/suite/Data/HashTable/Test/Common.hs view
@@ -26,13 +26,9 @@ import Prelude hiding (lookup, mapM_) import System.Random.MWC import System.Timeout-import Test.Framework-import Test.Framework.Providers.HUnit-import Test.Framework.Providers.QuickCheck2-import Test.HUnit (assertEqual,- assertFailure)-import Test.QuickCheck (arbitrary, choose,- generate)+import Test.Tasty+import Test.Tasty.HUnit hiding (assert)+import Test.Tasty.QuickCheck import Test.QuickCheck.Monadic (PropertyM, assert, forAllM, monadicIO, pre, run)@@ -49,7 +45,7 @@ ------------------------------------------------------------------------------ type FixedTableType h = forall k v . IOHashTable h k v-type HashTest = forall h . C.HashTable h => String -> FixedTableType h -> Test+type HashTest = forall h . C.HashTable h => String -> FixedTableType h -> TestTree data SomeTest = SomeTest HashTest @@ -95,7 +91,7 @@ -------------------------------------------------------------------------------tests :: C.HashTable h => String -> FixedTableType h -> Test+tests :: C.HashTable h => String -> FixedTableType h -> TestTree tests prefix dummyArg = testGroup prefix $ map f ts where f (SomeTest ht) = ht prefix dummyArg@@ -351,7 +347,7 @@ timeout_ :: Int -> IO a -> IO ()-#ifdef PORTABLE+#if defined(PORTABLE) || defined(wasm32_HOST_ARCH) timeout_ t m = timeout t m >>= maybe (assertFailure "timeout") (const $ return ()) #else
test/suite/TestSuite.hs view
@@ -2,7 +2,7 @@ module Main where -import Test.Framework (defaultMain)+import Test.Tasty (defaultMain, testGroup) ------------------------------------------------------------------------------ import qualified Data.HashTable.Test.Common as Common import qualified Data.HashTable.ST.Basic as B@@ -13,7 +13,7 @@ ------------------------------------------------------------------------------ main :: IO ()-main = defaultMain tests+main = defaultMain $ testGroup "All" tests where dummyBasicTable = Common.dummyTable :: forall k v . IO.IOHashTable (B.HashTable) k v