about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_table_access_when.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_table_access_when.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_table_access_when.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_table_access_when.txt b/js/scripting-lang/scratch_tests/test_table_access_when.txt
new file mode 100644
index 0000000..4161b19
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_table_access_when.txt
@@ -0,0 +1,11 @@
+/* Test table access in when expressions */
+user : {role: "admin", level: 5};
+
+test_table_access : u ->
+  when u.role is
+    "admin" then "admin user"
+    "user" then "regular user"
+    _ then "unknown role";
+
+result : test_table_access user;
+..out result; 
\ No newline at end of file