make Arbitrary POSIXTime include decimal half the time
This commit is contained in:
parent
2ca408dc33
commit
5ad5d45d4c
2 changed files with 11 additions and 13 deletions
|
@ -269,16 +269,8 @@ instance Arbitrary MTime where
|
|||
arbitrary = frequency
|
||||
-- timestamp is not usually negative
|
||||
[ (50, MTimeLowRes <$> (abs . fromInteger <$> arbitrary))
|
||||
, (50, MTimeHighRes <$> (abs <$> arbposixtime))
|
||||
, (50, MTimeHighRes <$> arbitrary)
|
||||
]
|
||||
where
|
||||
-- include fractional part, which the usual instance does not
|
||||
arbposixtime = do
|
||||
t <- arbitrary
|
||||
f <- arbitrary
|
||||
return $ if f == 0
|
||||
then t
|
||||
else t + recip f
|
||||
|
||||
#ifdef mingw32_HOST_OS
|
||||
instance Arbitrary FileID where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue