git.iko.soy/typeable/swagger2
on master help sign in
use quickcheck-instances
commit10beedb42a5d75fdf4a7ee07cace21cddcfbba1d authorMatt Parsons <parsonsmatt@gmail.com> dateWed 7 Mar 2018, 11:24 (9 years ago) parentd04f678
2 files changed+9−4
swagger2.cabal+2−1 test/Data/Swagger/Schema/ValidationSpec.hs+7−3
swagger2.cabal+2−1
@@ -92,6 +92,7 @@ test-suite spec
9292 , HUnit
9393 , mtl
9494 , QuickCheck >=2.8.2
95+ , quickcheck-instances
9596 , swagger2
9697 , text
9798 , time
@@ -99,7 +100,7 @@ test-suite spec
99100 , vector
100101 , lens
101102 if !impl(ghc >= 8.0)
102− build-depends: semigroups >= 0.18.3 && <0.19
103+ build-depends: semigroups
103104
104105 other-modules:
105106 SpecCommon
test/Data/Swagger/Schema/ValidationSpec.hs+7−3
@@ -33,6 +33,7 @@ import Data.Swagger.Declare
3333import Test.Hspec
3434import Test.Hspec.QuickCheck
3535import Test.QuickCheck
36+import Test.QuickCheck.Instances ()
3637
3738shouldValidate :: (ToJSON a, ToSchema a) => Proxy a -> a -> Bool
3839shouldValidate _ x = validateToJSON x == []
@@ -230,6 +231,10 @@ invalidButtonImagesToJSON = genericToJSON defaultOptions
230231instance Arbitrary ButtonImages where
231232 arbitrary = ButtonImages <$> arbitrary
232233
234+instance Eq ZonedTime where
235+ ZonedTime t (TimeZone x _ _) == ZonedTime t' (TimeZone y _ _) = t == t' && x == y
236+
237+{-
233238-- Arbitrary instances for common types
234239
235240instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
@@ -252,9 +257,6 @@ instance Arbitrary LocalTime where
252257 <$> arbitrary
253258 <*> liftA3 TimeOfDay (choose (0, 23)) (choose (0, 59)) (fromInteger <$> choose (0, 60))
254259
255−instance Eq ZonedTime where
256− ZonedTime t (TimeZone x _ _) == ZonedTime t' (TimeZone y _ _) = t == t' && x == y
257−
258260instance Arbitrary ZonedTime where
259261 arbitrary = ZonedTime
260262 <$> arbitrary
@@ -272,3 +274,5 @@ instance Arbitrary a => Arbitrary (NonEmpty a) where
272274 arbitrary = liftA2 (:|) arbitrary arbitrary
273275 shrink (x :| xs) = mapMaybe nonEmpty (shrink (x:xs))
274276#endif
277+
278+-}