diff options
Diffstat (limited to 'js/scripting-lang/tests/10_standard_library.txt')
-rw-r--r-- | js/scripting-lang/tests/10_standard_library.txt | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/js/scripting-lang/tests/10_standard_library.txt b/js/scripting-lang/tests/10_standard_library.txt index 91b5610..221d5ca 100644 --- a/js/scripting-lang/tests/10_standard_library.txt +++ b/js/scripting-lang/tests/10_standard_library.txt @@ -2,52 +2,39 @@ /* 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 */ -filtered1 : filter @isPositive 5; -filtered2 : filter @isPositive -3; - -..out "filtered1 = "; -..out filtered1; -..out "filtered2 = "; -..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 - COMMENTED OUT FOR DEBUGGING */ -/* -reduced : reduce @add 0 5; -folded : fold @add 0 5; +/* Reduce and Fold functions */ +reduced : reduce @add_func 0 5; +folded : fold @add_func 0 5; ..assert reduced = 5; ..assert folded = 5; -*/ -/* Curry function - COMMENTED OUT FOR DEBUGGING */ -/* -curried : curry @add 3 4; +/* Curry function */ +curried : curry @add_func 3 4; ..assert curried = 7; -*/ ..out "Standard library test completed"; \ No newline at end of file |