forked from k1LoW/runn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expr.yml
36 lines (36 loc) · 842 Bytes
/
expr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
desc: Expression evaluation engine
vars:
itemId: B
items:
- itemId: A
name: Product A
price: 100
- itemId: B
name: Product B
price: 50
- itemId: C
name: Product C
price: 150
products:
A:
name: productA
B:
name: productB
keyString: runn
steps:
filterItemId:
dump: filter(vars.items, {.itemId == vars.itemId})[0].name
testAllPriceGte50:
test: all(vars.items, {.price >= 50}) == true
lenPriceEqual1000:
test: len(filter(vars.items, {.price == 100})) == 1
getProductWithKey:
dump: vars.products["A"]
getProductWithKey2:
dump: vars.products.B
concatString:
dump: ("k1LoW/" + vars.keyString)
containsString:
test: (vars.keyString startsWith "run") == true
whereIn:
test: (vars.keyString in ["runn", "hoge", "fuga"]) == true