Skip to content

Commit

Permalink
more tests for #11757
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Dec 19, 2024
1 parent 2fe9906 commit cbe47f7
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions test/Table_Tests/src/Common_Table_Operations/Expression_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ add_expression_specs suite_builder detailed setup =

_ -> group_builder.specify label Nothing pending

db_null_pending = if setup.is_database && prefix.contains "SQLite" . not then "TODO #11757 - Nothing in expressions in DB"

suite_builder.group prefix+"Expression Integer literals" group_builder->
specify_test "should be able to add an integer column" group_builder expression_test->
expression_test "1" 1
Expand Down Expand Up @@ -141,7 +143,7 @@ add_expression_specs suite_builder detailed setup =
c.name.should_equal "[X] == '\0'"
c.to_vector.should_equal [True, False, False]

suite_builder.group prefix+"Expression Nothing literals" pending=(if setup.is_database && prefix.contains "SQLite" . not then "TODO #11757 - Nothing in expressions in DB") group_builder->
suite_builder.group prefix+"Expression Nothing literals" pending=db_null_pending group_builder->
specify_test "should be able to add an nothing column" group_builder expression_test->
expression_test "null" Nothing
expression_test "nUlL" Nothing
Expand Down Expand Up @@ -321,13 +323,14 @@ add_expression_specs suite_builder detailed setup =
specify_test "should be able to check null" group_builder expression_test->
expression_test "1 IS NULL" False
expression_test "1 IS NoTHing" False
expression_test "Nothing IS NULL" True
expression_test "1 IS NOT NULL" True
expression_test "Nothing IS NOT NULL" False
expression_test "[A] IS NULL" [False, False, False, False, False]
expression_test "[C] IS NULL" [False, False, False, False, True]
expression_test "[A] IS NOT NULL" [True, True, True, True, True]
expression_test "[C] IS NOT NULL" [True, True, True, True, False]
if db_null_pending.is_nothing then
expression_test "Nothing IS NULL" True
expression_test "Nothing IS NOT NULL" False

specify_test "should be able to check empty" group_builder expression_test->
expression_test "'Hello World' IS EMPTY" False
Expand Down Expand Up @@ -355,10 +358,12 @@ add_expression_specs suite_builder detailed setup =
suite_builder.group prefix+"Expression Boolean Operators" group_builder->
specify_test "should be able to AND booleans" group_builder expression_test->
expression_test "True && TRUE" True
expression_test "True && Nothing" Nothing
expression_test "True AND False" False
expression_test "Nothing && False" False
expression_test "Nothing && True" Nothing

if db_null_pending.is_nothing then
expression_test "True && Nothing" Nothing
expression_test "Nothing && False" False
expression_test "Nothing && True" Nothing

expression_test "True && [Bad]] Name]" [True, False, True, False, True]
expression_test "False AND [Bad]] Name]" False
Expand All @@ -367,8 +372,10 @@ add_expression_specs suite_builder detailed setup =
expression_test "True || TRUE" True
expression_test "True OR False" True
expression_test "False OR False" False
expression_test "Nothing || False" Nothing
expression_test "Nothing || True" True

if db_null_pending.is_nothing then
expression_test "Nothing || False" Nothing
expression_test "Nothing || True" True

expression_test "True OR [Bad]] Name]" True
expression_test "False || [Bad]] Name]" [True, False, True, False, True]
Expand Down

0 comments on commit cbe47f7

Please sign in to comment.