mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
fix ls with empty string (#12086)
# Description Fixes: #12054 It's cause by nu always add `/*` if there is a parameter in ls, then `ls ""` becomes `ls "/*"`. This pr tries to fix it by only append `/` character if pattern is not empty. # User-Facing Changes NaN # Tests + Formatting Done # After Submitting NaN --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -701,3 +701,13 @@ fn list_flag_false() {
|
||||
assert_eq!(actual.out, "false");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_empty_string() {
|
||||
Playground::setup("ls_empty_string", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![EmptyFile("yehuda.txt")]);
|
||||
|
||||
let actual = nu!(cwd: dirs.test(), "ls ''");
|
||||
assert!(actual.err.contains("does not exist"));
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user