mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Fix ls panics when a file or directory not exists (#6148)
* Fix ls panics when a file or directory not exists Fixes #6146 Signed-off-by: nibon7 <nibon7@163.com> * add test Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
@ -527,3 +527,11 @@ fn can_list_system_folder() {
|
||||
));
|
||||
assert_eq!(ls_with_filter.err, "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_a_directory_not_exists() {
|
||||
Playground::setup("ls_test_directory_not_exists", |dirs, _sandbox| {
|
||||
let actual = nu!(cwd: dirs.test(), "ls a_directory_not_exists");
|
||||
assert!(actual.err.contains("directory not found"));
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user