about summary refs log tree commit diff
path: root/tests/javascript.scm
diff options
context:
space:
mode:
authorArun Isaac2025-12-17 16:33:06 +0000
committerArun Isaac2025-12-17 16:33:06 +0000
commit433650cdf5c74cf4016434bd11d313158bf9792d (patch)
treebd19564de1b9e5f853969edfb86f810d1c260386 /tests/javascript.scm
parentbd4ccd3afdd185c1030336d86c2c15726f9e874a (diff)
downloadravanan-433650cdf5c74cf4016434bd11d313158bf9792d.tar.gz
ravanan-433650cdf5c74cf4016434bd11d313158bf9792d.tar.lz
ravanan-433650cdf5c74cf4016434bd11d313158bf9792d.zip
javascript: Implement function body expressions.
Diffstat (limited to 'tests/javascript.scm')
-rw-r--r--tests/javascript.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/javascript.scm b/tests/javascript.scm
index 9f86e7f..4a58f3a 100644
--- a/tests/javascript.scm
+++ b/tests/javascript.scm
@@ -178,4 +178,12 @@
   (evaluate-javascript-expression "$(1 - (2 - 1))"
                                   '()))
 
+(test-equal "evaluate javascript function body"
+  2
+  (evaluate-javascript-expression "${switch (inputs.message) { case \"foo\": return 1; case \"bar\": return 2; default: return 3}}"
+                                  '(("inputs" . (("message" . "bar")
+                                                 ("threads" . 48)))
+                                    ("self" . #f)
+                                    ("runtime" . #f))))
+
 (test-end "javascript")