mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
topdown: fix partial-eval test rejected by new conflict check
The 'partial set, general ref head' shallow-inlining test paired a set rule (p.q contains x) with an object-of-sets rule (p.q[r].s contains t) sharing the name p.q. That is exactly the set-vs-object conflict this change now rejects at compile time, and it panics at eval time on main, so the fixture is itself an invalid policy. Replace it with a single general-ref partial-set rule that keeps the shallow-inlining full-extent path under test, and update the expected support module. Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
This commit is contained in:
committed by
Stephan Renatus
parent
f11a2c2279
commit
d0bd3b7a19
@@ -1507,14 +1507,12 @@ func TestTopDownPartialEval(t *testing.T) {
|
||||
modules: []string{
|
||||
`package test
|
||||
import future.keywords.contains
|
||||
p.q contains x if { input.x = x }
|
||||
p.q[r].s contains t if { input.r = r; input.t = t }`,
|
||||
},
|
||||
wantQueries: []string{`data.partial.test.p.q = x`},
|
||||
wantSupport: []string{`
|
||||
package partial.test.p
|
||||
import future.keywords.contains
|
||||
q contains x2 if { input.x = x2 }
|
||||
q[r1].s contains t1 if { input.r = r1; input.t = t1 }
|
||||
`},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user