mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
fix wrong error msg of save
command on windows (#14699)
fixes #14664 # Description Now, ```nu "aaa" | save -f .. ``` returns correct error message on windows. Note that the fix introduces a TOCTOU problem, which only effects the error message. It won't break any workload. # User-Facing Changes The fix won't break any workload. # Tests + Formatting I have run tests **only on windows**. # After Submitting The fix doesn't need to change documentation.
This commit is contained in:
@ -525,3 +525,12 @@ fn parent_redirection_doesnt_affect_save() {
|
||||
assert_eq!(actual.trim_end(), "");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn force_save_to_dir() {
|
||||
let actual = nu!(cwd: "crates/nu-command/tests/commands", r#"
|
||||
"aaa" | save -f ..
|
||||
"#);
|
||||
|
||||
assert!(actual.err.contains("Is a directory"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user