diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_simple_function.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_simple_function.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_simple_function.txt b/js/scripting-lang/scratch_tests/test_simple_function.txt new file mode 100644 index 0000000..d7929d6 --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_simple_function.txt @@ -0,0 +1,14 @@ +/* Simple function application test */ + +x : 5; +f : x -> x * 2; +g : x -> x + 1; + +/* Test 1: Simple function application */ +result1 : f x; /* Should be apply(f, x) = 10 */ + +/* Test 2: Function composition */ +result2 : f g x; /* Should be apply(f, apply(g, x)) = 12 */ + +/* Test 3: Multiple arguments */ +result3 : f g 3; /* Should be apply(f, apply(g, 3)) = 8 */ \ No newline at end of file |