mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 02:28:35 +02:00
remove without check path exist, rm -f
(#2590)
This commit is contained in:
@ -125,7 +125,6 @@ fn removes_directory_contents_with_recursive_flag() {
|
||||
fn errors_if_attempting_to_delete_a_directory_with_content_without_recursive_flag() {
|
||||
Playground::setup("rm_test_6", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![EmptyFile("some_empty_file.txt")]);
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.root(),
|
||||
"rm rm_test_6"
|
||||
@ -265,3 +264,15 @@ fn remove_files_from_two_parents_up_using_multiple_dots_and_glob() {
|
||||
));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_errors_if_attempting_to_delete_non_existent_file_with_f_flag() {
|
||||
Playground::setup("rm_test_14", |dirs, _| {
|
||||
let actual = nu!(
|
||||
cwd: dirs.root(),
|
||||
"rm -f non_existent_file.txt"
|
||||
);
|
||||
|
||||
assert!(!actual.err.contains("no valid path"));
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user