Files
regorus/tests/interpreter/cases/nonstrict/tests.yaml
Anand Krishnamoorthi 863601c2d5 Propagate Undefined in object expressions (#171)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-03-05 09:56:15 -08:00

55 lines
1.2 KiB
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: builtin error gobbled up in non strict mode
modules:
- |
package test
a = to_number("abc")
query: data.test
want_result: {}
strict: false
- note: builtin error in strict mode
modules:
- |
package test
a = to_number("abc")
query: data.test
error: "could not parse string as number"
- note: count of null error gobbled up in non strict mode
modules:
- |
package test
import rego.v1
foo := input.a
some_id := {
"count_value": count(foo) > 2,
}
input:
a: null
query: data.test
strict: false
want_result:
foo: null
- note: count of null error in strict mode
modules:
- |
package test
import rego.v1
foo := input.a
some_id := {
"count_value": count(foo) > 2,
(count(foo) > 2): "count_value",
}
input:
a: null
query: data.test
error: "`count` requires array/object/set/string argument"