---
cases:
  - note: "negation/pos: ref with variable"
    query: data.test.p = x
    modules:
      - |
        package test

        p := y if {
        	y := "v0"
        	not data.test.q[y]
        }

        q contains x if {
        	data.b[x] = v
        }
    data:
      b:
        v1: hello
        v2: goodbye
    want_result:
      - x: v0
  - note: "negation/neg: ref with variable"
    query: data.test.p = x
    modules:
      - |
        package test

        p := y if {
        	y := "v1"
        	not data.test.q[y]
        }

        q contains x if {
        	data.b[x] = v
        }
    data:
      b:
        v1: hello
        v2: goodbye
    want_result: []
  - note: "negation/neg: ref with variable (hit) and virtual doc (miss))"
    query: data.foo.p = x
    modules:
      - |
        package foo

        p if {
        	k := "p"
        	not data.bar[k]
        }
      - |
        package bar

        p := 7
    data:
      bar:
        q: "8"
    want_result: []
  - note: "negation/neg: ref with variable (miss) and virtual doc (hit)"
    query: data.foo.p = x
    modules:
      - |
        package foo

        p if {
        	k := "q"
        	not data.bar[k]
        }
      - |
        package bar

        p := 7
    data:
      bar:
        q: "8"
    want_result: []
