about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2026-01-28 19:09:10 +0000
committerArun Isaac2026-01-28 21:02:19 +0000
commitd980fcd1a5fdbe0fc5e1833c7366903d4b0c3685 (patch)
tree2fdd0012c06af04719956721d682abbdcd1ceb6a /tests
parent55d04bbe46581d6e0f3da97f7b9339ccf5738d21 (diff)
downloadravanan-d980fcd1a5fdbe0fc5e1833c7366903d4b0c3685.tar.gz
ravanan-d980fcd1a5fdbe0fc5e1833c7366903d4b0c3685.tar.lz
ravanan-d980fcd1a5fdbe0fc5e1833c7366903d4b0c3685.zip
javascript: Allow whitespace within javascript string interpolation.
We now trim procedurally instead of relying on the PEG grammar. It's
simpler, and it actually works.
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/javascript.scm b/tests/javascript.scm
index eb70373..133e65e 100644
--- a/tests/javascript.scm
+++ b/tests/javascript.scm
@@ -1,5 +1,5 @@
 ;;; ravanan --- High-reproducibility CWL runner powered by Guix
-;;; Copyright © 2024–2025 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2024–2026 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of ravanan.
 ;;;
@@ -214,4 +214,20 @@
   (evaluate-javascript-expression " $(1 + 1)\n"
                                   '()))
 
+(test-equal "allow whitespace characters in between javascript expressions"
+  "2\t5"
+  (evaluate-javascript-expression "$(1 + 1)\t$(2 + 3)\n"
+                                  '()))
+
+(test-equal "allow string literal with whitespace characters in between javascript expressions"
+  "2foo 5"
+  (evaluate-javascript-expression "$(1 + 1)foo $(2 + 3)\n"
+                                  '()))
+
+(test-equal "complex awk expression that has whitespace characters and javascript expressions"
+  "($1 == \"foo\") && (start <= $2) && ($2 <= end)"
+  (evaluate-javascript-expression "($1 == \"$(inputs.label)\") && (start <= $2) && ($2 <= end)"
+                                  '(("inputs"
+                                     ("label" . "foo")))))
+
 (test-end "javascript")