Skip to content

Commit 507e2f6

Browse files
committed
Harden wasm tests
1 parent f8e028f commit 507e2f6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/conftest_wasm.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ def subprocess_run(
170170
raise RuntimeError(f"Error setting cwd to {cwd}")
171171

172172
def maybe_wrap_arg(s: str | MockPath) -> str:
173-
# An argument containing spaces needs to be wrapped in quotes if it is not already, due
174-
# to how the command is passed to cockle as a single string.
173+
# An argument containing whitespace (including newlines) needs to be wrapped in quotes if
174+
# it is not already, due to how the command is passed to cockle as a single string.
175175
# Could do better here.
176176
s = str(s)
177-
if " " in s and not s.endswith("'"):
177+
if re.search(r"\s", s) and not s.endswith("'"):
178178
return "'" + s + "'"
179179
return s
180180

0 commit comments

Comments
 (0)