cases:
  - note: short circuit
    query: data.x.p = 1
    modules:
      - |
        package x
        p = 1 { true }
        else = 2 { true }
    want_defined: true
  - note: fallthrough
    query: data.x.p = 2
    modules:
      - |
        package x
        p = 1 { false }
        else = 2 { true }
        else = 3 { true }
    want_defined: true
  - note: fallthrough second
    query: data.x.p = 3
    modules:
      - |
        package x
        p = 1 { false }
        else = 2 { false }
        else = 3 { true }
    want_defined: true
  - note: fallthrough multiple
    query: data.x.p = 5
    modules:
      - |
        package x
        p = 1 { false }
        else = 2 { false }
        else = 3 { false }
        p = 4 { false }
        else = 5 { true }
    want_defined: true
  - note: short circuit (iteration)
    query: data.x.p = 1
    modules:
      - |
        package x
        p = 1 { input.x[_] = 1 }
        else = 2 { true }
    input: {"x": [3,2,1]}
    want_defined: true
  - note: fallthrough (iteration)
    query: data.x.p = 1
    modules:
      - |
        package x
        p = 1 { input.x[_] = "deadbeef" }
        else = 2 { input.x[_] = 1 }
    input: {"x": [3,2,1]}
    want_defined: false
  - note: chain
    query: data.x.p = 3
    modules:
      - |
        package x
        p = 1 { false }
        else = q { true }
        q = 2 { false }
        else = r { true }
        r = 3
    want_defined: true
  - note: chain (input)
    query: data.x.p = 2
    modules:
      - |
        package x
        p = q
        q = 1 { input.deadbeef = 1 }
        else = 2 { input.x = 2 }
    want_defined: true
    input: {"x": 2}
  - note: functions short circuit
    query: data.x.f(1) = 1
    modules:
      - |
        package x
        f(x) = 1 { true }
        else = 2 { true }
    want_defined: true
  - note: functions fallthrough
    query: data.x.f(1) = 3
    modules:
      - |
        package x
        f(x) = 1 { false }
        else = 2 { false }
        else = 3 { true }
    want_defined: true