diff options
Diffstat (limited to 'js/scripting-lang/tests/17_table_enhancements_minimal.txt')
-rw-r--r-- | js/scripting-lang/tests/17_table_enhancements_minimal.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/js/scripting-lang/tests/17_table_enhancements_minimal.txt b/js/scripting-lang/tests/17_table_enhancements_minimal.txt new file mode 100644 index 0000000..bdb1c96 --- /dev/null +++ b/js/scripting-lang/tests/17_table_enhancements_minimal.txt @@ -0,0 +1,31 @@ +/* Minimal Unit Test: Table Enhancements */ + +/* Enhanced map with tables */ +numbers : {1, 2, 3, 4, 5}; +double : x -> x * 2; + +/* Test map with single table */ +doubled : map @double numbers; +first : doubled[1]; +second : doubled[2]; +..assert first = 2; +..assert second = 4; + +/* Test t.map */ +t_doubled : t.map @double numbers; +t_first : t_doubled[1]; +..assert t_first = 2; + +/* Test each */ +each_add : each @add numbers 10; +each_1 : each_add[1]; +..assert each_1 = 11; + +/* Test embedded functions */ +calculator : { + add: x y -> x + y +}; +add_result : calculator.add 5 3; +..assert add_result = 8; + +..out "Minimal table enhancements test completed"; \ No newline at end of file |