on master help sign in
Fix fake-broken DotNetTime test
commit3b61b782eb8fbe5e75db2e00fe93f1bce67b266c authorBryan O'Sullivan <bos@serpentine.com> dateMon 22 Apr 2013, 21:53 (13 years ago) parent25972f6
2 files changed+3−5
tests/Instances.hs+2−1 tests/Types.hs+1−4
tests/Instances.hs+2−1
@@ -57,7 +57,8 @@ instance ApproxEq UTCTime where
5757 a =~ b = ((==) `on` utctDay) a b &&
5858 (approxEqWith 1 1 `on` ((* 1e3) . utctDayTime)) a b
5959
60−instance ApproxEq DotNetTime
60+instance ApproxEq DotNetTime where
61+ (=~) = (=~) `on` fromDotNetTime
6162
6263instance ApproxEq Double where
6364 (=~) = approxEq
tests/Types.hs+1−4
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DefaultSignatures, DeriveDataTypeable, DeriveGeneric,
1+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric,
22 GeneralizedNewtypeDeriving #-}
33
44module Types where
@@ -37,9 +37,6 @@ data Sum4 a b c d = Alt1 a | Alt2 b | Alt3 c | Alt4 d
3737class ApproxEq a where
3838 (=~) :: a -> a -> Bool
3939
40− default (=~) :: (Eq a) => a -> a -> Bool
41− (=~) = (==)
42−
4340newtype Approx a = Approx { fromApprox :: a }
4441 deriving (Show, Data, Typeable, Generic, ApproxEq, Num)
4542