Skip to content

Commit

Permalink
Fix warnings in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Dec 15, 2024
1 parent 712930c commit 9b34e59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bitvec.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ category: Data, Bit Vectors
author: Andrew Lelechenko <andrew.lelechenko@gmail.com>,
James Cook <mokus@deepbondi.net>

tested-with: GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.1 GHC ==8.8.2 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.8 GHC ==9.4.8 GHC ==9.6.6 GHC ==9.8.2 GHC ==9.10.1
tested-with: GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.1 GHC ==8.8.2 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.8 GHC ==9.4.8 GHC ==9.6.6 GHC ==9.8.4 GHC ==9.10.1 GHC ==9.12.1
extra-doc-files:
changelog.md
README.md

source-repository head
type: git
location: git://github.com/Bodigrim/bitvec.git
location: https://github.com/Bodigrim/bitvec.git

flag simd
description:
Expand Down
10 changes: 6 additions & 4 deletions test/Tests/MVector.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}


#ifndef BITVEC_THREADSAFE
module Tests.MVector (mvectorTests) where
Expand Down Expand Up @@ -76,7 +78,7 @@ prop_flipBit xs (NonNegative k) = U.length xs > 0 ==> ys === ys'
where
k' = k `mod` U.length xs
ys = U.modify (\v -> M.modify v complement k') xs
ys' = U.modify (\v -> flipBit v k') xs
ys' = U.modify (`flipBit` k') xs

case_write_init_read1 :: Property
case_write_init_read1 = (=== Bit True) $ runST $ do
Expand Down Expand Up @@ -233,7 +235,7 @@ prop_grow_def xs (NonNegative m) = runST $ do

prop_castFromWords_def :: N.New U.Vector Word -> Property
prop_castFromWords_def ws =
runST (N.run ws >>= pure . castFromWordsM >>= V.unsafeFreeze)
runST (N.run ws >>= V.unsafeFreeze . castFromWordsM)
=== castFromWords (V.new ws)

prop_cloneToWords_def :: N.New U.Vector Bit -> Property
Expand Down Expand Up @@ -266,12 +268,12 @@ prop_replicate_neg :: Positive Int -> Bit -> Property
prop_replicate_neg (Positive n) x = ioProperty $ do
ret <- try (evaluate (runST $ MG.basicUnsafeReplicate (-n) x >>= U.unsafeFreeze))
pure $ property $ case ret of
Left ErrorCallWithLocation{} -> True
Left (_ :: SomeException) -> True
_ -> False

prop_new_neg :: Positive Int -> Property
prop_new_neg (Positive n) = ioProperty $ do
ret <- try (evaluate (runST $ MG.basicUnsafeNew (-n) >>= U.unsafeFreeze :: U.Vector Bit))
pure $ property $ case ret of
Left ErrorCallWithLocation{} -> True
Left (_ :: SomeException) -> True
_ -> False

0 comments on commit 9b34e59

Please sign in to comment.