@@ -5,9 +5,11 @@ module Data.SwaggerSpec where
6import Data.Aeson
6import Data.Aeson
7import Data.Aeson.QQ
7import Data.Aeson.QQ
8+import qualified Data.Foldable as F
8import Data.HashMap.Strict (HashMap)
9import Data.HashMap.Strict (HashMap)
9import qualified Data.HashMap.Strict as HashMap
10import qualified Data.HashMap.Strict as HashMap
10import Data.Maybe
11import Data.Maybe
11import qualified Data.Vector as Vector
13import qualified Data.Vector as Vector
12import Data.Text (Text)
14import Data.Text (Text)
@@ -17,10 +19,10 @@ import Test.Hspec
18isSubJSON :: Value -> Value -> Bool
20isSubJSON :: Value -> Value -> Bool
19isSubJSON Null _ = True
21isSubJSON Null _ = True
20−isSubJSON (Object x) (Object y) = HashMap.keys x == HashMap.keys i && and i
22+isSubJSON (Object x) (Object y) = HashMap.keys x == HashMap.keys i && F.and i
22 i = HashMap.intersectionWith isSubJSON x y
24 i = HashMap.intersectionWith isSubJSON x y
23−isSubJSON (Array xs) (Array ys) = Vector.length xs == Vector.length ys && and (Vector.zipWith isSubJSON xs ys)
25+isSubJSON (Array xs) (Array ys) = Vector.length xs == Vector.length ys && F.and (Vector.zipWith isSubJSON xs ys)
24isSubJSON x y = x == y
26isSubJSON x y = x == y
26(<~>) :: (Eq a, Show a, ToJSON a, FromJSON a) => a -> Value -> Spec
28(<~>) :: (Eq a, Show a, ToJSON a, FromJSON a) => a -> Value -> Spec