Skip to content

Commit

Permalink
[mmzk] (refactor) Fix name shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
MMZK1526 committed Apr 19, 2024
1 parent 7f4f410 commit a194ff1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ v7Test = do
tid <- genID @TypeID "mmzk"
tid' <- genID @TypeID "foo"
let mapping = M.fromList [(tid, tid')]
let json = encode mapping
decode json `shouldBe` Just mapping
fmap encode (decode @(Map TypeID TypeID) json) `shouldBe` Just json
let tJson = encode mapping
decode tJson `shouldBe` Just mapping
fmap encode (decode @(Map TypeID TypeID) tJson) `shouldBe` Just tJson
describe "Valid JSON value" do
forM_ valid \(TestData n tid (Just pref) (Just uid)) -> it n do
case decode @TypeID (fromString $ show tid) of
Expand Down Expand Up @@ -365,9 +365,9 @@ v1Test = do
tid <- genID @TypeIDV1 "mmzk"
tid' <- genID @TypeIDV1 "foo"
let mapping = M.fromList [(tid, tid')]
let json = encode mapping
decode json `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV1 TypeIDV1) json) `shouldBe` Just json
let tJson = encode mapping
decode tJson `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV1 TypeIDV1) tJson) `shouldBe` Just tJson
describe "Valid JSON value" do
forM_ valid \(TestData n tid (Just pref) (Just uid)) -> it n do
case decode @TypeIDV1 (fromString $ show tid) of
Expand Down Expand Up @@ -546,9 +546,9 @@ v4Test = do
tid <- genID @TypeIDV4 "mmzk"
tid' <- genID @TypeIDV4 "foo"
let mapping = M.fromList [(tid, tid')]
let json = encode mapping
decode json `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV4 TypeIDV4) json) `shouldBe` Just json
let tJson = encode mapping
decode tJson `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV4 TypeIDV4) tJson) `shouldBe` Just tJson
describe "Valid JSON value" do
forM_ valid \(TestData n tid (Just pref) (Just uid)) -> it n do
case decode @TypeIDV4 (fromString $ show tid) of
Expand Down Expand Up @@ -731,9 +731,9 @@ v5Test = do
tid <- genID @TypeIDV5 "mmzk" uid [11, 45, 14]
tid' <- genID @TypeIDV5 "foo" uid [11, 45, 14]
let mapping = M.fromList [(tid, tid')]
let json = encode mapping
decode json `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV5 TypeIDV5) json) `shouldBe` Just json
let tJson = encode mapping
decode tJson `shouldBe` Just mapping
fmap encode (decode @(Map TypeIDV5 TypeIDV5) tJson) `shouldBe` Just tJson
describe "Valid JSON value" do
forM_ valid \(TestData n tid (Just pref) (Just uid)) -> it n do
case decode @TypeIDV5 (fromString $ show tid) of
Expand Down

0 comments on commit a194ff1

Please sign in to comment.