Skip to content

Commit

Permalink
Add failing test for nullable operand problem
Browse files Browse the repository at this point in the history
  • Loading branch information
kamoii committed Oct 31, 2020
1 parent 7ed2484 commit 7f67f4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion selda-tests/test/Tests/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import Database.Nelda.Query.SqlExpression (max_, min_, sum_, avg, count, false,
import qualified Database.Nelda.Query.SqlExpression as Nelda
import qualified Database.Nelda.Query.SqlExpressionUnsafe as Unsafe
import qualified Database.Nelda.Query.SqlExpressionUnsafe as Usafe
import Database.Nelda.SQL.Col (Col)
import Database.Nelda.SQL.Col (literal, Col)
import Database.Nelda.SQL.RowHasFieldInstance ()
import qualified Database.Nelda.Schema.ColumnType as CT
import Database.Nelda.SqlType (SqlType)
Expand Down Expand Up @@ -116,8 +116,14 @@ queryTests run =
-- , "string concatenation" ~: run stringConcatenation
-- , "teardown succeeds" ~: run teardown
-- , "if not exists works" ~: run (setup >> resetup)
, "nullable operands" ~: run nullableOperands
]

nullableOperands = do
-- そもそもが型が Nullable になる必要がある
[b] <- query $ pure $ just (4 :: Col s Int) .== literal Nothing
assEq "wrong results from select" False b

simpleSelect = do
ppl <- query $ select people
assEq "wrong results from select" (sort peopleItems) (sort ppl)
Expand Down

0 comments on commit 7f67f4a

Please sign in to comment.