Implement an option to show paths made of mkdir. (#1932)

This commit is contained in:
utam0k
2020-06-07 04:13:38 +09:00
committed by GitHub
parent ba6370621f
commit 15e66ae065
3 changed files with 39 additions and 5 deletions

View File

@ -1,6 +1,6 @@
use nu_test_support::fs::files_exist_at;
use nu_test_support::nu;
use nu_test_support::playground::Playground;
use nu_test_support::{nu, pipeline};
use std::path::Path;
#[test]
@ -61,3 +61,25 @@ fn create_directory_two_parents_up_using_multiple_dots() {
assert!(expected.exists());
})
}
#[test]
fn show_created_paths() {
Playground::setup("mkdir_test_2", |dirs, _| {
let actual = nu!(
cwd: dirs.test(),
pipeline(
r#"
mkdir -s dir_1 dir_2 dir_3
| count
| echo $it
"#
));
assert!(files_exist_at(
vec![Path::new("dir_1"), Path::new("dir_2"), Path::new("dir_3")],
dirs.test()
));
assert_eq!(actual.out, "3");
})
}