mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
24 lines
542 B
YAML
24 lines
542 B
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
cases:
|
|
- note: basic
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
x1 = y {
|
|
y = [ [a, b] | a = [1, 2, 3, 4][b] ]
|
|
}
|
|
x2 = y {
|
|
y = [ [a, b] | a = {1, 2, 3, 4}[b] ]
|
|
}
|
|
x3 = y {
|
|
y = [ [a, b] | a = {"p":"q", "r": "s"}[b] ]
|
|
}
|
|
query: data.test
|
|
want_result:
|
|
x1: [[1, 0], [2, 1], [3, 2], [4, 3]]
|
|
x2: [[1, 1], [2, 2], [3, 3], [4, 4]]
|
|
x3: [["q", "p"], ["s", "r"]]
|