Fix failing unit tests on Windows (#5142) (#5143)

* Fix failing unit tests on Windows (#5142)

Fix let_env_expressions failing on Windows:
The env expression uses PATH, but on windows Path is used.

Fix correctly_escape_external_arguments, execute_binary_in_string
failing on Windows:
Using cococo now to make sure testresults are platform independent

* Update macros.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
This commit is contained in:
Boy van Duuren
2022-04-11 20:18:46 +02:00
committed by GitHub
parent 57761149f4
commit 594006cfa0
3 changed files with 28 additions and 7 deletions

View File

@ -66,7 +66,7 @@ fn automatically_change_directory_with_trailing_slash_and_same_name_as_command()
#[test]
fn correctly_escape_external_arguments() {
let actual = nu!(cwd: ".", r#"^echo '$0'"#);
let actual = nu!(cwd: ".", r#"^nu --testbin cococo '$0'"#);
assert_eq!(actual.out, "$0");
}
@ -76,8 +76,8 @@ fn execute_binary_in_string() {
let actual = nu!(
cwd: ".",
r#"
let cmd = "echo"
^$"($cmd)" "$0"
let cmd = "nu"
^$"($cmd)" --testbin cococo "$0"
"#);
assert_eq!(actual.out, "$0");