about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_debug_map.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_debug_map.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_debug_map.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_debug_map.txt b/js/scripting-lang/scratch_tests/test_debug_map.txt
new file mode 100644
index 0000000..7d178f2
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_debug_map.txt
@@ -0,0 +1,27 @@
+/* Debug test for map function */
+
+/* Test basic map functionality */
+double : x -> x * 2;
+numbers : {1, 2, 3};
+doubled : map @double numbers;
+..out "Doubled numbers:";
+..out doubled;
+
+/* Test map with equals */
+is_zero : x -> equals x 0;
+test_values : {0, 1, 2};
+zero_test : map @is_zero test_values;
+..out "Zero test:";
+..out zero_test;
+
+/* Test with our specific case */
+mod3 : n -> n % 3;
+mod5 : n -> n % 5;
+div_15 : {mod3 15, mod5 15};
+..out "Div 15:";
+..out div_15;
+
+divisibility : n -> map @is_zero {mod3 n, mod5 n};
+result : divisibility 15;
+..out "Divisibility result:";
+..out result; 
\ No newline at end of file