From d980fcd1a5fdbe0fc5e1833c7366903d4b0c3685 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 28 Jan 2026 19:09:10 +0000 Subject: 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. --- tests/javascript.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tests') 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 +;;; Copyright © 2024–2026 Arun Isaac ;;; ;;; 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") -- cgit 1.4.1