Skip to content

Commit

Permalink
test: tck tests now check that AND and OR operators are short circuit…
Browse files Browse the repository at this point in the history
… evaluated (#1279)

* test: tck tests now check that AND and OR operators are short circuit evaluated

Signed-off-by: Calum Murray <[email protected]>

* fix: test for OR short circuiting uses the OR operator

Signed-off-by: Calum Murray <[email protected]>

* test: verify that AND and OR only short circuit when expected to

Signed-off-by: Calum Murray <[email protected]>

---------

Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 authored May 23, 2024
1 parent d697a87 commit e79d7b2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cesql/cesql_tck/binary_logical_operators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ tests:
- name: True and true
expression: TRUE AND TRUE
result: true
- name: AND operator is short circuit evaluated
expression: "false and (1 != 1 / 0)"
result: false
- name: AND operator is NOT short circuit evaluated when the first operand evaluates to true
expression: "true and (1 != 1 / 0)"
error: math

- name: False or false
expression: FALSE OR FALSE
Expand All @@ -25,6 +31,12 @@ tests:
- name: True or true
expression: TRUE OR TRUE
result: true
- name: OR operator is short circuit evaluated
expression: "true or (1 != 1 / 0)"
result: true
- name: OR operator is NOT short circuit evaluated when the first operand evaluates to false
expression: "false or (1 != 1 / 0)"
error: math

- name: False xor false
expression: FALSE XOR FALSE
Expand Down

0 comments on commit e79d7b2

Please sign in to comment.