Skip to content

Commit

Permalink
make tests compatible with hashable 1.3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
turboMaCk committed Mar 13, 2021
1 parent 8ba3814 commit a0bf729
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/JSONEncodeSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ encodePrimitives = describe "primitives" $ do
objectEncoding :: Spec
objectEncoding = do
let object = Object "Joe" 30
let json = "{\"age\":30,\"name\":\"Joe\"}"

-- poor man's workaround for key ordering
-- see: https://github.com/haskell/aeson/issues/837
let json res =
res == "{\"age\":30,\"name\":\"Joe\"}"
|| res == "{\"name\":\"Joe\",\"age\":30}"

describe "object encoding" $ do
it "should encode using getter style encoding" $ do
JE.encode objectEncoder object `shouldBe` json
JE.encode objectEncoder object `shouldSatisfy` json

it "should encode using explicit style encoding" $ do
JE.encode objectEncoder' object `shouldBe` json
JE.encode objectEncoder' object `shouldSatisfy` json


listSpec :: Spec
Expand Down

0 comments on commit a0bf729

Please sign in to comment.