about summary refs log tree commit diff stats
path: root/js/scripting-lang/baba-yaga-c/tests/18_each_combinator.txt
blob: 45c941a2421ac75dd9b6e5accb5d6ab3ac074abb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Simple each test */

numbers : {1, 2, 3, 4, 5};

/* each with table and scalar */
each_add : each @add numbers 10;
each_1 : each_add[1];
each_2 : each_add[2];
each_3 : each_add[3];
..assert each_1 = 11;
..assert each_2 = 12;
..assert each_3 = 13;

/* each with two tables */
table1 : {a: 1, b: 2, c: 3};
table2 : {a: 10, b: 20, c: 30};
each_sum : each @add table1 table2;
..assert each_sum.a = 11;
..assert each_sum.b = 22;
..assert each_sum.c = 33;

..out "Simple each test completed";