diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_composition_debug.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_composition_debug.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_composition_debug.txt b/js/scripting-lang/scratch_tests/test_composition_debug.txt new file mode 100644 index 0000000..fd5e052 --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_composition_debug.txt @@ -0,0 +1,16 @@ +/* Test function composition with multiple functions */ +f1 : x -> x + 1; +f2 : x -> x * 2; +f3 : x -> x - 1; +f4 : x -> x / 2; + +composed1 : compose @f1 (compose @f2 (compose @f3 @f4)) 10; +composed2 : pipe @f4 (pipe @f3 (pipe @f2 @f1)) 10; + +..out "composed1 = "; +..out composed1; +..out "composed2 = "; +..out composed2; + +..assert composed1 = 9; +..assert composed2 = 10.5; \ No newline at end of file |