From 1abdae217e59ce6a82581e510b5ae7ea3fac9f26 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 20 Oct 2025 14:02:20 +0200 Subject: [PATCH] shell: Clean up try_quote tests --- crates/util/src/shell.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/util/src/shell.rs b/crates/util/src/shell.rs index 485e19dd1386fe4c31fbf5adb46028eac5e16983..8ed27184b7dc90c03accde3cd1e8850ad940213a 100644 --- a/crates/util/src/shell.rs +++ b/crates/util/src/shell.rs @@ -500,10 +500,22 @@ mod tests { let shell_kind = ShellKind::PowerShell; assert_eq!( shell_kind - .try_quote("pwsh.exe -c \"echo \"hello there\"\"") + .try_quote("C:\\Users\\johndoe\\dev\\python\\39007\\tests\\.venv\\Scripts\\python.exe -m pytest \"test_foo.py::test_foo\"") .unwrap() .into_owned(), - "\"echo `\"hello there`\"\"".to_string() + "\"C:\\Users\\johndoe\\dev\\python\\39007\\tests\\.venv\\Scripts\\python.exe -m pytest `\"test_foo.py::test_foo`\"\"".to_string() + ); + } + + #[test] + fn test_try_quote_cmd() { + let shell_kind = ShellKind::Cmd; + assert_eq!( + shell_kind + .try_quote("C:\\Users\\johndoe\\dev\\python\\39007\\tests\\.venv\\Scripts\\python.exe -m pytest \"test_foo.py::test_foo\"") + .unwrap() + .into_owned(), + "\"C:\\Users\\johndoe\\dev\\python\\39007\\tests\\.venv\\Scripts\\python.exe -m pytest \\\"test_foo.py::test_foo\\\"\"".to_string() ); } }