Skip to content

Commit

Permalink
add test for nested interpolations (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin authored May 1, 2024
1 parent 6b6d906 commit c4db595
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_7runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

0 comments on commit c4db595

Please sign in to comment.