diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_embedded_functions_minimal.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_embedded_functions_minimal.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_embedded_functions_minimal.txt b/js/scripting-lang/scratch_tests/test_embedded_functions_minimal.txt new file mode 100644 index 0000000..8a516f0 --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_embedded_functions_minimal.txt @@ -0,0 +1,40 @@ +/* Minimal embedded functions test */ + +// Test 1: Basic arrow functions +basic : { + identity: x -> x, + double: x -> x * 2 +}; + +// Test 2: When expressions +classifier : { + classify: x -> when x is + 0 then "zero" + _ then "other" +}; + +// Test 3: Mixed content tables +mixed : { + name: "Calculator", + add: x y -> x + y +}; + +// Output tests +..out "=== MINIMAL EMBEDDED FUNCTIONS TEST ==="; + +..out "Basic functions:"; +id_result : basic.identity 42; +..out id_result; +double_result : basic.double 21; +..out double_result; + +..out "Classifier functions:"; +class_zero : classifier.classify 0; +..out class_zero; +class_other : classifier.classify 99; +..out class_other; + +..out "Mixed table:"; +..out mixed.name; +mixed_add : mixed.add 15 25; +..out mixed_add; \ No newline at end of file |