about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_func_debug_detailed.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_func_debug_detailed.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_func_debug_detailed.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_func_debug_detailed.txt b/js/scripting-lang/scratch_tests/test_func_debug_detailed.txt
new file mode 100644
index 0000000..fb96ce5
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_func_debug_detailed.txt
@@ -0,0 +1,24 @@
+/* Detailed debugging of function calls in when expressions */
+
+/* Helper functions for testing */
+is_even : n -> n % 2 = 0;
+
+/* Test the function directly */
+test1 : is_even 4;
+test2 : is_even 7;
+..out test1;
+..out test2;
+
+/* Number classification using function calls in patterns */
+classify_number : n ->
+  when (is_even n) is
+    true then "even number"
+    false then "odd number";
+
+/* Test number classification */
+even_class : classify_number 4;
+odd_class : classify_number 7;
+
+..out "Classification results:";
+..out even_class;
+..out odd_class; 
\ No newline at end of file