Skip to content

Commit

Permalink
Fix some shouldSatisfy predicates that were always True (#404)
Browse files Browse the repository at this point in the history
* Add dependencies to nix packages in stack.yaml

* Fix some shouldSatisfy predicates that were always True
  • Loading branch information
csamak authored Oct 17, 2024
1 parent eb719e7 commit 603e083
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Common/Record.hs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ testDeriveEsqueletoRecord = describe "deriveEsqueletoRecord" $ do
, myAddress = (Just (Entity addr2 Address {addressAddress = "30-50 Feral Hogs Rd"}))

Check warning on line 271 in test/Common/Record.hs

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

Defined but not used: ‘addr2’
}
)) -> True
_ -> True)
_ -> False)

itDb "can can handle joins on records with Nothing" $ do
setup
Expand All @@ -291,7 +291,7 @@ testDeriveEsqueletoRecord = describe "deriveEsqueletoRecord" $ do
, myAddress = (Just (Entity addr2 Address {addressAddress = "30-50 Feral Hogs Rd"}))
}
)) -> True
_ -> True)
_ -> False)

itDb "can left join on nested records" $ do
setup
Expand All @@ -312,7 +312,7 @@ testDeriveEsqueletoRecord = describe "deriveEsqueletoRecord" $ do
, myAddress = (Just (Entity addr2 Address {addressAddress = "30-50 Feral Hogs Rd"}))
}
})) -> True
_ -> True)
_ -> False)

itDb "can handle multiple left joins on the same record" $ do
setup
Expand All @@ -331,7 +331,7 @@ testDeriveEsqueletoRecord = describe "deriveEsqueletoRecord" $ do
, myAddress = (Just (Entity addr2 Address {addressAddress = "30-50 Feral Hogs Rd"}))
}
})) -> True
_ -> True)
_ -> False)
liftIO $ sortedRecords !! 1
`shouldSatisfy`
(\case (_ :& _ :& Just (MyNestedRecord {myRecord = MyRecord {myName = "Rebecca", myAddress = Nothing}})) -> True
Expand Down

0 comments on commit 603e083

Please sign in to comment.