diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_each_comprehensive.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_each_comprehensive.txt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_each_comprehensive.txt b/js/scripting-lang/scratch_tests/test_each_comprehensive.txt new file mode 100644 index 0000000..abcb74f --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_each_comprehensive.txt @@ -0,0 +1,43 @@ +/* Comprehensive test for each combinator */ + +numbers : {1, 2, 3, 4, 5}; +table1 : {a: 1, b: 2, c: 3}; +table2 : {a: 10, b: 20, c: 30}; + +/* Test 1: each with table and scalar */ +result1 : each @add numbers 10; +..out "Test 1 - each with table and scalar:"; +..out result1; + +/* Test 2: each with two tables */ +result2 : each @add table1 table2; +..out "Test 2 - each with two tables:"; +..out result2; + +/* Test 3: each with scalar and table */ +result3 : each @add 10 numbers; +..out "Test 3 - each with scalar and table:"; +..out result3; + +/* Test 4: each with partial application */ +add_to_ten : each @add 10; +result4 : add_to_ten numbers; +..out "Test 4 - each with partial application:"; +..out result4; + +/* Test 5: each with different operations */ +result5 : each @multiply numbers 2; +..out "Test 5 - each with multiply:"; +..out result5; + +/* Test 6: each with comparison */ +result6 : each @greaterThan numbers 3; +..out "Test 6 - each with comparison:"; +..out result6; + +/* Test 7: each with nested tables */ +nested1 : {data: {x: 1, y: 2}, meta: {type: "point"}}; +nested2 : {data: {x: 10, y: 20}, meta: {type: "point"}}; +result7 : each @add nested1 nested2; +..out "Test 7 - each with nested tables:"; +..out result7; \ No newline at end of file |