Skip to content

Commit

Permalink
NonEmpty.singleton was added in GHC 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Jan 12, 2025
1 parent e84542a commit 1d57fb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions beam-postgres/test/Database/Beam/Postgres/Test/Select.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Database.Beam.Postgres.Test.Select (tests) where

import Data.Aeson
import Data.ByteString (ByteString)
import qualified Data.List.NonEmpty as NonEmpty
import Data.List.NonEmpty (NonEmpty(..))
import Data.Int
import qualified Data.Vector as V
import Test.Tasty
Expand Down Expand Up @@ -83,7 +83,7 @@ testUuuidInValues getConn = testCase "UUID in values_ works" $
pgCreateExtension @UuidOssp
let ext = getPgExtension $ _uuidOssp $ unCheckDatabase db
runSelectReturningList $ select $ do
v <- values_ (NonEmpty.singleton (val_ nil))
v <- values_ (val_ nil :| [])
return $ pgUuidGenerateV5 ext v ""
assertEqual "result" [V5.generateNamed nil []] result

Expand Down
3 changes: 1 addition & 2 deletions beam-sqlite/test/Database/Beam/Sqlite/Test/Select.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Data.Int (Int32)
import Database.Beam
import Database.Beam.Sqlite
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.List.NonEmpty as NonEmpty
import Test.Tasty
import Test.Tasty.ExpectedFailure
import Test.Tasty.HUnit
Expand Down Expand Up @@ -53,5 +52,5 @@ testExceptValues :: TestTree
testExceptValues = testCase "EXCEPT with VALUES works" $
withTestDb $ \conn -> do
result <- runBeamSqlite conn $ runSelectReturningList $ select $
values_ ((as_ @Bool $ val_ True) :| [ val_ False]) `except_` values_ (NonEmpty.singleton (val_ False))
values_ ((as_ @Bool $ val_ True) :| [val_ False]) `except_` values_ (val_ False :| [])
assertEqual "result" [True] result

0 comments on commit 1d57fb9

Please sign in to comment.