Skip to content

Commit

Permalink
Merge pull request #89 from amesgen/fix-tests
Browse files Browse the repository at this point in the history
Fix `RealFrac Seconds` instance
  • Loading branch information
CetinSert committed Aug 9, 2023
2 parents dd4fcc6 + f588bcb commit 1b41f50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
wasi:
runs-on: ubuntu-latest
env:
GHC_WASM_META_REV: 5a5c10c3b7e2f9f55bb2f40601cb20c9eb599bb5
GHC_WASM_META_REV: 895f7067e1d4c918a45559da9d2d6a403a690703
FLAVOUR: '9.6'
steps:
- name: Setup WASI GHC
Expand Down
2 changes: 1 addition & 1 deletion System/Clock/Seconds.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ instance Fractional Seconds where

instance RealFrac Seconds where
properFraction (Seconds (TimeSpec s ns))
| s >= 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
| s >= 0 || ns == 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
| otherwise = (fromIntegral (s+1), Seconds $ TimeSpec (-1) ns)

-- | The 'getTime' function shall return the current value for the
Expand Down
7 changes: 6 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ packages: .
-- Andreas Abel, 2022-02-07, issue #72: Fix cyclic dependencies.
-- The default would be tasty +clock, but this creates a dependency cycle.
constraints:
tasty -clock
tasty -clock

-- otherwise, we get CI failures
if impl(ghc ==8.2.*)
package text
flags: -simdutf

0 comments on commit 1b41f50

Please sign in to comment.