Skip to content

Commit

Permalink
Resolve test warnings
Browse files Browse the repository at this point in the history
This resolves #82. The code in that MR worked but it produced warnings
in the current default lts for the project. I used the qualified import
trick to resolve the warning. Then the partial matches started failing
in newer GHC versions so I resolved that too. This now builds without
warnings on the project LTS, the newest LTS and nightly.
  • Loading branch information
MichaelXavier committed Apr 17, 2023
1 parent 09e1ef2 commit 25584dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/Tests/Control/Retry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Control.Applicative
import Control.Concurrent
import Control.Concurrent.STM as STM
import qualified Control.Exception as EX
import Control.Monad as M ( forM_ )
import Control.Monad.Catch
import Control.Monad.Except
import Control.Monad.Identity
Expand Down Expand Up @@ -285,8 +286,8 @@ capDelayTests = testGroup "capDelay"
cap <- forAll (Gen.int (Range.linear 1 maxBound))
let policy = capDelay cap (limitRetries retries)
let delays = runIdentity (simulatePolicy (retries + 1) policy)
let Just lastDelay = lookup (retries - 1) delays
let Just gaveUp = lookup retries delays
let lastDelay = fromMaybe (error "impossible: empty delays") (lookup (retries - 1) delays)
let gaveUp = fromMaybe (error "impossible: empty delays") (lookup retries delays)
let noDelay = 0
lastDelay === Just noDelay
gaveUp === Nothing
Expand Down Expand Up @@ -388,7 +389,7 @@ overridingDelayTests = testGroup "overriding delay"
(handler delays)
(action delays)
let expectedDelays = map microsToNominalDiffTime delays
forM_ (zip (diffTimes measuredTimestamps) expectedDelays) $
M.forM_ (zip (diffTimes measuredTimestamps) expectedDelays) $
\(actual, expected) -> diff actual (>=) expected


Expand Down

0 comments on commit 25584dc

Please sign in to comment.