Skip to content

Commit

Permalink
Test.Utils.prop_addToClockTime_identity
Browse files Browse the repository at this point in the history
that test should spot the addToClockTime bug faster than prop_timediffAdd
haskell/old-time#18
  • Loading branch information
thielema committed Aug 15, 2024
1 parent 099cfcc commit 4fcafe1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/hs/Test/Ganeti/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ instance Arbitrary ClockTime where
arbitrary =
TOD <$> choose (946681200, 2082754800) <*> choose (0, 999999999999)

prop_addToClockTime_identity :: ClockTime -> Property
prop_addToClockTime_identity a =
addToClockTime noTimeDiff a ==? a

-- | Verify our work-around for ghc bug #2519. Taking `diffClockTimes` form
-- `System.Time`, this test fails with an exception.
prop_timediffAdd :: ClockTime -> ClockTime -> ClockTime -> Property
Expand Down Expand Up @@ -400,6 +404,7 @@ testSuite "Utils"
, 'case_new_uuid_regex
#endif
, 'prop_clockTimeToString
, 'prop_addToClockTime_identity
, 'prop_timediffAdd
, 'prop_chompPrefix_normal
, 'prop_chompPrefix_last
Expand Down

0 comments on commit 4fcafe1

Please sign in to comment.