Skip to content

Commit

Permalink
[mmzk] (refactor) Fix name shadowing and use actions/cache@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
MMZK1526 committed Apr 19, 2024
1 parent 7f4f410 commit 4cd0bf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.1'
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-cabal
with:
Expand Down
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 4cd0bf2

Please sign in to comment.