about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_when_in_table_simple.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_when_in_table_simple.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_when_in_table_simple.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_when_in_table_simple.txt b/js/scripting-lang/scratch_tests/test_when_in_table_simple.txt
new file mode 100644
index 0000000..7ac89fc
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_when_in_table_simple.txt
@@ -0,0 +1,13 @@
+/* Simple when expression in table test */
+
+// Test when expression in table
+test : {
+    classify: x -> when x is
+        0 then "zero"
+        _ then "other"
+};
+
+// Test it
+..out "=== WHEN IN TABLE SIMPLE TEST ===";
+result : test.classify 0;
+..out result; 
\ No newline at end of file