File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ Library
9696 containers >= 0.5 && < 0.8 ,
9797 deepseq >= 1.1 && < 1.6 ,
9898 lens >= 3.8.7 && < 5.4 ,
99+ quickcheck-instances < 0.4 ,
99100 regex-base >= 0.93 && < 0.95 ,
100101 regex-tdfa >= 1.1.0 && < 1.4 ,
101102 safe >= 0.3.3 && < 0.4 ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import Data.Time
1919
2020import GHC.Stack
2121import Test.QuickCheck as QC
22+ import Test.QuickCheck.Instances.Time ()
2223
2324utcFormat :: String
2425utcFormat = " %Y-%m-%dT%H:%M:%SZ"
@@ -136,19 +137,3 @@ unsafeParseDay :: HasCallStack => T.Text -> Day
136137unsafeParseDay t = fromMaybe (error msg) (parseDay t)
137138 where
138139 msg = " unsafeParseDay: unable to parse: " ++ T. unpack t
139-
140-
141- -- TODO: use a more arbitrary instance (quickcheck-instances?)
142- -- (in particular, there are no subsecond-resolution times here)
143- instance QC. Arbitrary UTCTime where
144- arbitrary = QC. oneof
145- [ QC. elements [mk " 2010-01-01T00:00:00Z"
146- , mk " 2013-05-27T19:13:50Z"
147- , mk " 2011-07-20T22:04:00Z"
148- , mk " 2012-02-02T15:45:11Z"
149- , mk " 2009-11-12T20:57:54Z"
150- , mk " 2000-10-28T21:03:24Z"
151- , mk " 1965-03-10T09:23:01Z"
152- ]]
153- where
154- mk = unsafeParseUTC
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ import qualified Data.Text as T
5252import qualified Data.Text.Encoding as T
5353import qualified Data.ByteString.Char8 as B
5454import Test.QuickCheck as QC
55+ import Test.QuickCheck.Instances.Text ()
5556import Control.Applicative
5657import qualified Data.ByteString.Base64 as B64
5758import Language.Haskell.TH
@@ -334,9 +335,6 @@ instance ToJSON Binary where
334335instance FromJSON Binary where
335336 parseJSON = withBinary " Binary" return
336337
337- instance QC. Arbitrary T. Text where
338- arbitrary = T. pack <$> QC. arbitrary
339-
340338instance QC. Arbitrary Binary where
341339 arbitrary = Binary <$> B. pack <$> QC. arbitrary
342340
You can’t perform that action at this time.
0 commit comments