git.iko.soy/typeable/openapi3
on master help sign in
Fix GHC 7.8 build
843f943Nickolay Kudasov
test/Data/SwaggerSpec.hs+4−2
@@ -5,9 +5,11 @@ module Data.SwaggerSpec where
5
5
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
12+import Data.Monoid
11import qualified Data.Vector as Vector
13import qualified Data.Vector as Vector
12import Data.Text (Text)
14import Data.Text (Text)
13
15
@@ -17,10 +19,10 @@ import Test.Hspec
17
19
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
21 where
23 where
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
25
27
26(<~>) :: (Eq a, Show a, ToJSON a, FromJSON a) => a -> Value -> Spec
28(<~>) :: (Eq a, Show a, ToJSON a, FromJSON a) => a -> Value -> Spec