about summary refs log tree commit diff stats
path: root/js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt')
-rw-r--r--js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt51
1 files changed, 0 insertions, 51 deletions
diff --git a/js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt b/js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt
deleted file mode 100644
index 75fda40..0000000
--- a/js/scripting-lang/baba-yaga-c/tests/08_first_class_functions.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Unit Test: First-Class Functions */
-/* Tests: Function references, higher-order functions */
-
-/* Basic functions */
-double : x -> x * 2;
-square : x -> x * x;
-add1 : x -> x + 1;
-
-/* Function references */
-double_ref : @double;
-square_ref : @square;
-add1_ref : @add1;
-
-/* Test function references */
-result1 : double_ref 5;
-result2 : square_ref 3;
-result3 : add1_ref 10;
-
-..assert result1 = 10;
-..assert result2 = 9;
-..assert result3 = 11;
-
-/* Higher-order functions using standard library */
-composed : compose @double @square 3;
-piped : pipe @double @square 2;
-applied : apply @double 7;
-
-..assert composed = 18;
-..assert piped = 16;
-..assert applied = 14;
-
-/* Function references in case expressions */
-getFunction : type -> 
-  when type is
-    "double" then @double
-    "square" then @square
-    _        then @add1;
-
-func1 : getFunction "double";
-func2 : getFunction "square";
-func3 : getFunction "unknown";
-
-result4 : func1 4;
-result5 : func2 4;
-result6 : func3 4;
-
-..assert result4 = 8;
-..assert result5 = 16;
-..assert result6 = 5;
-
-..out "First-class functions test completed"; 
\ No newline at end of file