From d77a4f0b1cd16d0c4e8ed93686606561da6b0bd9 Mon Sep 17 00:00:00 2001 From: Mike Lin Date: Sun, 18 Feb 2024 22:35:39 -1000 Subject: [PATCH] WIP test for nested interpolations --- tests/test_7runner.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/test_7runner.py b/tests/test_7runner.py index 992c8e41..d36d44b6 100644 --- a/tests/test_7runner.py +++ b/tests/test_7runner.py @@ -1429,3 +1429,39 @@ def test_more(self): } """, {"p": {"name": os.path.join(self._dir, "alyssa.txt"), "age": 42}}) assert outp["message"] == "Hello, Alyssa!" + +class TestNestedInterpolations(RunnerTestCase): + wdl = """ + workflow w { + String a = "Alice" + Array[String] bc = ["Bob", "Carol"] + String sp = " " + + call t + + output { + String message = "Hello ${a + "${sp}"}!" + String task_out = t.out + } + } + task t { + input {} + String a = "Alice" + Array[String] bc = ["Bob", "Carol"] + String sp = " " + + command <<< + echo 'Hello ~{a + "~{sp}~{sep=' ' bc}"}!' + >>> + + output { + String out = read_string(stdout()) + } + } + """ + + def test_all(self): + for version in ("1.1", "development"): + outp = self._run(f"version {version}\n" + self.wdl, {}) + assert outp["message"] == "Hello Alice !" + assert outp["task_out"].strip() == "Hello Alice Bob Carol!"