cases:
  - note: match/array simple
    query: "input.x = [y]; input.y = y"
    input: {"x": [1], "y": 1}
    want_defined: true
  - note: match/array simple (negative)
    query: "input.x = [y]; input.y = y"
    input: {"x": [1], "y": 2}
    want_defined: false
  - note: match/array nested
    query: "input.x = [[y], 1]; input.y = [y]"
    input: {"x": [[0], 1], "y": [0]}
    want_defined: true
  - note: match/array nested (negative)
    query: "input.x = [[y], 1]; input.y = [y]"
    input: {"x": [[0], 1], "y": [1]}
    want_defined: false
  - note: match/object simple
    query: 'input.x = {"a": y}; input.y = y'
    input: {"x": {"a": 1}, "y": 1}
    want_defined: true
  - note: match/object simple (negative)
    query: 'input.x = {"a": y}; input.y = y'
    input: {"x": {"a": 1}, "y": 2}
    want_defined: false
  - note: match/object nested
    query: 'input.x = {"a": {"b": y}, "c": 1}; input.y = {"a": y}'
    input: {"x": {"a": {"b": 0}, "c": 1}, "y": {"a": 0}}
    want_defined: true
  - note: match/object nested (negative)
    query: 'input.x = {"a": {"b": y}, "c": 1}; input.y = {"a": y}'
    input: {"x": {"a": {"b": 0}, "c": 1}, "y": {"a": 1}}
    want_defined: false
  - note: match/reference operand
    query: |
      x = {[1, 1], [1, 2], [1, 3]}; x[[1, y]][1] == 2
    want_defined: true
  - note: match/reference operand (negative)
    query: |
      x = {[1, 1], [1, 2], [1, 3]}; x[[1, y]][1] == "deadbeef"
    want_defined: false
