mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
- emit AssertCondition for equality-only assignment plans (outside soft-assert mode) so rules like `0 = 1` fail under the VM just like the interpreter - let comprehension bodies consume assertion failures by advancing or exiting their iteration context, both in run-to-completion and suspendable execution Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
63 lines
1.1 KiB
YAML
63 lines
1.1 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
# Comparison Operations Test Suite
|
|
# Tests comparison operators: ==, <, >, <=, >=, !=
|
|
|
|
cases:
|
|
- note: comparison_equals
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
main := result if {
|
|
result := (5 == 5)
|
|
}
|
|
query: data.test.main
|
|
want_result: true
|
|
|
|
- note: comparison_not_equals
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
main := result if {
|
|
result := (5 == 3)
|
|
}
|
|
query: data.test.main
|
|
want_result: false
|
|
|
|
- note: comparison_less_than
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
main := result if {
|
|
result := (3 < 5)
|
|
}
|
|
query: data.test.main
|
|
want_result: true
|
|
|
|
- note: comparison_greater_than
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
main := result if {
|
|
result := (7 > 5)
|
|
}
|
|
query: data.test.main
|
|
want_result: true
|
|
|
|
- note: equality_literal_failure
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
x if {
|
|
0 = 1
|
|
}
|
|
query: data.test.x
|
|
want_result: "#undefined"
|