git.iko.soy/typeable/openapi3
on master help sign in
Don't define Arbitrary for container instances when QuickCheck >=2.8.2
66f5005Nickolay Kudasov
test/Data/Swagger/Schema/ValidationSpec.hs+7−4
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE PackageImports #-}
2{-# LANGUAGE PackageImports #-}
2module Data.Swagger.Schema.ValidationSpec where
3module Data.Swagger.Schema.ValidationSpec where
3
4
@@ -79,18 +80,20 @@ spec = do
79main :: IO ()
80main :: IO ()
80main = hspec spec
81main = hspec spec
81
82
82−
83+#if MIN_VERSION_QuickCheck(2,8,2)
84+#else
83instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) where
85instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) where
84 arbitrary = Map.fromList <$> arbitrary
86 arbitrary = Map.fromList <$> arbitrary
85
87
86−instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
87− arbitrary = HashMap.fromList <$> arbitrary
88−
89instance Arbitrary a => Arbitrary (IntMap a) where
88instance Arbitrary a => Arbitrary (IntMap a) where
90 arbitrary = IntMap.fromList <$> arbitrary
89 arbitrary = IntMap.fromList <$> arbitrary
91
90
92instance (Ord a, Arbitrary a) => Arbitrary (Set a) where
91instance (Ord a, Arbitrary a) => Arbitrary (Set a) where
93 arbitrary = Set.fromList <$> arbitrary
92 arbitrary = Set.fromList <$> arbitrary
93+#endif
94+
95+instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
96+ arbitrary = HashMap.fromList <$> arbitrary
94
97
95instance (Eq a, Hashable a, Arbitrary a) => Arbitrary (HashSet a) where
98instance (Eq a, Hashable a, Arbitrary a) => Arbitrary (HashSet a) where
96 arbitrary = HashSet.fromList <$> arbitrary
99 arbitrary = HashSet.fromList <$> arbitrary