@@ -27,6 +27,25 @@ instance Arbitrary L.Text where
27instance Arbitrary Day where
27instance Arbitrary Day where
28 arbitrary = liftA3 fromGregorian (fmap abs arbitrary) arbitrary arbitrary
28 arbitrary = liftA3 fromGregorian (fmap abs arbitrary) arbitrary arbitrary
30+instance Arbitrary LocalTime where
31+ arbitrary = LocalTime
33+ <*> liftA3 TimeOfDay (choose (0, 23)) (choose (0, 59)) (fromInteger <$> choose (0, 60))
35+instance Eq ZonedTime where
36+ ZonedTime t (TimeZone x _ _) == ZonedTime t' (TimeZone y _ _) = t == t' && x == y
38+instance Arbitrary ZonedTime where
39+ arbitrary = ZonedTime
41+ <*> liftA3 TimeZone arbitrary arbitrary (vectorOf 3 (elements ['A'..'Z']))
43+instance Arbitrary UTCTime where
44+ arbitrary = UTCTime <$> arbitrary <*> fmap fromInteger (choose (0, 86400))
46+instance Arbitrary NominalDiffTime where
47+ arbitrary = fromInteger <$> arbitrary
30instance Arbitrary Version where
49instance Arbitrary Version where
31 arbitrary = (version . map abs) <$> nonempty
50 arbitrary = (version . map abs) <$> nonempty
@@ -89,6 +108,10 @@ spec = do
89 checkUrlPiece (Proxy :: Proxy T.Text) "Text.Strict"
108 checkUrlPiece (Proxy :: Proxy T.Text) "Text.Strict"
90 checkUrlPiece (Proxy :: Proxy L.Text) "Text.Lazy"
109 checkUrlPiece (Proxy :: Proxy L.Text) "Text.Lazy"
91 checkUrlPiece (Proxy :: Proxy Day) "Day"
110 checkUrlPiece (Proxy :: Proxy Day) "Day"
111+ checkUrlPiece (Proxy :: Proxy LocalTime) "LocalTime"
112+ checkUrlPiece (Proxy :: Proxy ZonedTime) "ZonedTime"
113+ checkUrlPiece (Proxy :: Proxy UTCTime) "UTCTime"
114+ checkUrlPiece (Proxy :: Proxy NominalDiffTime) "NominalDiffTime"
92 checkUrlPiece (Proxy :: Proxy Version) "Version"
115 checkUrlPiece (Proxy :: Proxy Version) "Version"
94 checkUrlPiece (Proxy :: Proxy (Maybe String)) "Maybe String"
117 checkUrlPiece (Proxy :: Proxy (Maybe String)) "Maybe String"