# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

cases:
  - note: basic
    rego: |
      package test
      import future.keywords.in

      x = 5 in [4, 5]

      # in-exprs are left associative and ahve lower-precedence than bin-expr.
      # The following will be parsed as
      # (5 in [4, 5]) in (set() | {true})
      z = 5 in [4, 5] in set() | {true}
    num_expressions: 21
    num_statements: 0
    num_queries: 0
    policy:
      - spec:
          head:
            compr:
              refr:
                var: x
                eidx: 4
              assign:
                op: "="
                value:
                  inexpr:
                    value:
                      number: 5
                      eidx: 5
                    collection:
                      array:
                        - number: 4
                          eidx: 6
                        - number: 5
                          eidx: 7
                      eidx: 8
                  eidx: 9
          bodies: []
      - spec:
          head:
            compr:
              refr:
                var: z
                eidx: 10
              assign:
                op: "="
                value:
                  inexpr:
                    value:
                      inexpr:
                        value:
                          number: 5
                          eidx: 11
                        collection:
                          array:
                            - number: 4
                              eidx: 12
                            - number: 5
                              eidx: 13
                          eidx: 14
                      eidx: 15
                    collection:
                      binexpr:
                        op: "|"
                        lhs:
                          set: []
                          eidx: 16
                        rhs:
                          set:
                            - bool: true
                              eidx: 17
                          eidx: 18
                      eidx: 19
                  eidx: 20
          bodies: []
