2019-08-15 22:18:18 +00:00
|
|
|
mod helpers;
|
|
|
|
|
2019-12-06 18:07:53 +00:00
|
|
|
use helpers::Playground;
|
|
|
|
|
2019-08-15 22:18:18 +00:00
|
|
|
#[test]
|
|
|
|
fn external_command() {
|
2019-08-29 06:31:56 +00:00
|
|
|
let actual = nu!(
|
2019-09-11 14:36:50 +00:00
|
|
|
cwd: "tests/fixtures",
|
|
|
|
"echo 1"
|
2019-08-29 06:31:56 +00:00
|
|
|
);
|
2019-08-15 22:18:18 +00:00
|
|
|
|
2019-08-29 00:32:42 +00:00
|
|
|
assert!(actual.contains("1"));
|
2019-08-15 22:18:18 +00:00
|
|
|
}
|
2019-12-06 18:07:53 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn spawn_external_process_with_home_in_arguments() {
|
|
|
|
Playground::setup("echo_tilde", |dirs, _| {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: dirs.test(),
|
|
|
|
r#"
|
|
|
|
sh -c "echo ~"
|
|
|
|
"#
|
|
|
|
);
|
|
|
|
|
|
|
|
assert!(
|
|
|
|
!actual.contains("~"),
|
|
|
|
format!("'{}' should not contain ~", actual)
|
|
|
|
);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn spawn_external_process_with_tilde_in_arguments() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: "tests/fixtures",
|
|
|
|
r#"
|
|
|
|
sh -c "echo 1~1"
|
|
|
|
"#
|
|
|
|
);
|
|
|
|
|
|
|
|
assert_eq!(actual, "1~1");
|
|
|
|
}
|