mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
fix: cover outer-scope bracket key handling
Agent-Logs-Url: https://github.com/microsoft/regorus/sessions/992f5462-7cc4-4e4f-bd7f-799308063765 Co-authored-by: anakrish <35780660+anakrish@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5ae1d8abf2
commit
eb6e156e8a
@@ -349,7 +349,7 @@ cases:
|
||||
package test
|
||||
import rego.v1
|
||||
default config["timeout"] := 30
|
||||
config["timeout"] := input.val if {
|
||||
config["timeout"] := val if {
|
||||
val := input.val
|
||||
}
|
||||
query: data.test.config.timeout
|
||||
@@ -364,7 +364,7 @@ cases:
|
||||
package test
|
||||
import rego.v1
|
||||
default config["timeout"] := 30
|
||||
config["timeout"] := input.val if {
|
||||
config["timeout"] := val if {
|
||||
val := input.val
|
||||
}
|
||||
query: data.test.config.timeout
|
||||
|
||||
@@ -201,6 +201,27 @@ cases:
|
||||
BAZ: true
|
||||
FOO: true
|
||||
|
||||
- note: partial_object_key_bound_in_outer_scope_v1
|
||||
data: {}
|
||||
input:
|
||||
outer:
|
||||
FOO: [1, 2]
|
||||
BAR: [3]
|
||||
BAZ: []
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
import rego.v1
|
||||
|
||||
violations[k] if {
|
||||
some k, arr in input.outer
|
||||
some _ in arr
|
||||
}
|
||||
query: data.test.violations
|
||||
want_result:
|
||||
BAR: true
|
||||
FOO: true
|
||||
|
||||
- note: complete_rule_same_value_definitions_still_work_v1
|
||||
data: {}
|
||||
input:
|
||||
|
||||
@@ -55,7 +55,7 @@ cases:
|
||||
package test
|
||||
import rego.v1
|
||||
default config["timeout"] := 30
|
||||
config["timeout"] := input.val if {
|
||||
config["timeout"] := val if {
|
||||
val := input.val
|
||||
}
|
||||
query: data.test.config.timeout
|
||||
@@ -70,7 +70,7 @@ cases:
|
||||
package test
|
||||
import rego.v1
|
||||
default config["timeout"] := 30
|
||||
config["timeout"] := input.val if {
|
||||
config["timeout"] := val if {
|
||||
val := input.val
|
||||
}
|
||||
query: data.test.config.timeout
|
||||
|
||||
@@ -186,7 +186,7 @@ cases:
|
||||
seen contains k if {
|
||||
some k, _ in input.x
|
||||
}
|
||||
|
||||
|
||||
main := {
|
||||
"seen": seen,
|
||||
"violations": violations,
|
||||
@@ -200,6 +200,27 @@ cases:
|
||||
BAZ: true
|
||||
FOO: true
|
||||
|
||||
- note: partial_object_key_bound_in_outer_scope_v1
|
||||
data: {}
|
||||
input:
|
||||
outer:
|
||||
FOO: [1, 2]
|
||||
BAR: [3]
|
||||
BAZ: []
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
import rego.v1
|
||||
|
||||
violations[k] if {
|
||||
some k, arr in input.outer
|
||||
some _ in arr
|
||||
}
|
||||
query: data.test.violations
|
||||
want_result:
|
||||
BAR: true
|
||||
FOO: true
|
||||
|
||||
- note: complete_rule_same_value_definitions_still_work_v1
|
||||
data: {}
|
||||
input:
|
||||
|
||||
Reference in New Issue
Block a user