about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_composition_working.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_composition_working.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_composition_working.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_composition_working.txt b/js/scripting-lang/scratch_tests/test_composition_working.txt
new file mode 100644
index 0000000..5ec1d4c
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_composition_working.txt
@@ -0,0 +1,33 @@
+/* Test working composition features */
+
+f : x -> x * 2;
+g : x -> x + 1;
+h : x -> x * x;
+
+/* Test 1: Basic composition */
+result1 : f via g 5;
+..out result1;
+
+/* Test 2: Multiple composition */
+result2 : f via g via h 3;
+..out result2;
+
+/* Test 3: Function references */
+result3 : @f;
+..out result3;
+
+/* Test 4: Function reference in composition */
+result4 : @f via @g 5;
+..out result4;
+
+/* Test 5: Pipe function */
+result5 : pipe(f, g) 5;
+..out result5;
+
+/* Test 6: Enhanced compose with multiple functions */
+result6 : compose(f, g, h) 2;
+..out result6;
+
+/* Test 7: Enhanced pipe with multiple functions */
+result7 : pipe(h, g, f) 2;
+..out result7; 
\ No newline at end of file