mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
Implement an option to show paths made of mkdir. (#1932)
This commit is contained in:
@ -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");
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user