This commit is the continuing phase of extracting functionality to subcrates. We extract test helpers and begin to change Nu shell's test organization along with it.

This commit is contained in:
Andrés N. Robalino
2019-12-15 11:15:06 -05:00
parent 4b9ef5a9d0
commit 4034129dba
64 changed files with 2184 additions and 2340 deletions

32
tests/shell/mod.rs Normal file
View File

@ -0,0 +1,32 @@
mod pipeline {
use test_support::fs::Stub::FileWithContent;
use test_support::playground::Playground;
use test_support::{nu_combined, pipeline};
#[test]
fn it_arg_works_with_many_inputs_to_external_command() {
Playground::setup("it_arg_works_with_many_inputs", |dirs, sandbox| {
sandbox.with_files(vec![
FileWithContent("file1", "text"),
FileWithContent("file2", " and more text"),
]);
let (stdout, stderr) = nu_combined!(
cwd: dirs.test(), pipeline(
r#"
echo hello world
| split-row " "
| ^echo $it
"#
));
#[cfg(windows)]
assert_eq!("hello world", stdout);
#[cfg(not(windows))]
assert_eq!("helloworld", stdout);
assert!(!stderr.contains("No such file or directory"));
})
}
}