Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some shouldSatisfy predicates that were always True #404

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/Common/Record.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
module Common.Record (testDeriveEsqueletoRecord) where

import Common.Test.Import hiding (from, on)
import Control.Monad.Trans.State.Strict (StateT(..), evalStateT)

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘Control.Monad.Trans.State.Strict’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘Control.Monad.Trans.State.Strict’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘Control.Monad.Trans.State.Strict’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘Control.Monad.Trans.State.Strict’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘Control.Monad.Trans.State.Strict’ is redundant
import Data.Bifunctor (first)

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘Data.Bifunctor’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘Data.Bifunctor’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘Data.Bifunctor’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘Data.Bifunctor’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘Data.Bifunctor’ is redundant
import Data.List (sortOn)
import Data.Maybe (catMaybes)

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘Data.Maybe’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘Data.Maybe’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘Data.Maybe’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘Data.Maybe’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘Data.Maybe’ is redundant
import Data.Proxy (Proxy(..))

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘Data.Proxy’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘Data.Proxy’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘Data.Proxy’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘Data.Proxy’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘Data.Proxy’ is redundant
import Database.Esqueleto.Experimental
import Database.Esqueleto.Internal.Internal (SqlSelect(..))

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘Database.Esqueleto.Internal.Internal’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘Database.Esqueleto.Internal.Internal’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘Database.Esqueleto.Internal.Internal’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘Database.Esqueleto.Internal.Internal’ is redundant

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘Database.Esqueleto.Internal.Internal’ is redundant
import Database.Esqueleto.Record (

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.6.5)

The import of ‘takeColumns, takeMaybeColumns’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

The import of ‘takeColumns, takeMaybeColumns’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

The import of ‘takeColumns, takeMaybeColumns’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

The import of ‘takeColumns, takeMaybeColumns’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

The import of ‘takeColumns, takeMaybeColumns’
DeriveEsqueletoRecordSettings(..),
defaultDeriveEsqueletoRecordSettings,
deriveEsqueletoRecord,
Expand Down Expand Up @@ -122,7 +122,7 @@
}

mySubselectRecordQuery :: SqlQuery (SqlExpr (Maybe (Entity Address)))
mySubselectRecordQuery = do

Check warning on line 125 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: ‘mySubselectRecordQuery’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.2.2)

Defined but not used: ‘mySubselectRecordQuery’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 9.0.2)

Defined but not used: ‘mySubselectRecordQuery’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.10.4)

Defined but not used: ‘mySubselectRecordQuery’

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

View workflow job for this annotation

GitHub Actions / build (3.10.2.1, 8.8.4)

Defined but not used: ‘mySubselectRecordQuery’
_ :& record <- from $
table @User
`leftJoin`
Expand Down Expand Up @@ -268,10 +268,10 @@
liftIO $ sortedRecords !! 1
`shouldSatisfy`
(\case ( _ :& Just ( MyRecord { myName = "Some Guy"
, 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 @@
, 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 @@
, 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 @@
, 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
Loading