diff options
Diffstat (limited to 'js/scripting-lang/tests/10_standard_library.txt')
-rw-r--r-- | js/scripting-lang/tests/10_standard_library.txt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/scripting-lang/tests/10_standard_library.txt b/js/scripting-lang/tests/10_standard_library.txt index e6f7160..6006b59 100644 --- a/js/scripting-lang/tests/10_standard_library.txt +++ b/js/scripting-lang/tests/10_standard_library.txt @@ -2,9 +2,9 @@ /* Tests: All built-in higher-order functions */ /* Basic functions for testing */ -double : x -> x * 2; -square : x -> x * x; -add : x y -> x + y; +double_func : x -> x * 2; +square_func : x -> x * x; +add_func : x y -> x + y; isPositive : x -> x > 0; /* Filter function - TESTING FAILING CASE */ @@ -17,33 +17,33 @@ filtered2 : filter @isPositive -3; ..out filtered2; /* Map function */ -mapped1 : map @double 5; -mapped2 : map @square 3; +mapped1 : map @double_func 5; +mapped2 : map @square_func 3; ..assert mapped1 = 10; ..assert mapped2 = 9; /* Compose function */ -composed : compose @double @square 3; +composed : compose @double_func @square_func 3; ..assert composed = 18; /* Pipe function */ -piped : pipe @double @square 2; +piped : pipe @double_func @square_func 2; ..assert piped = 16; /* Apply function */ -applied : apply @double 7; +applied : apply @double_func 7; ..assert applied = 14; /* Reduce and Fold functions */ -reduced : reduce @add 0 5; -folded : fold @add 0 5; +reduced : reduce @add_func 0 5; +folded : fold @add_func 0 5; ..assert reduced = 5; ..assert folded = 5; /* Curry function */ -curried : curry @add 3 4; +curried : curry @add_func 3 4; ..assert curried = 7; ..out "Standard library test completed"; \ No newline at end of file |