mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 18:41:53 +02:00
fix(completion): dotnu_completion dir with space, expand tilde (#14983)
# Description This PR closes #14956, only one known issue on that list remains. # User-Facing Changes # Tests + Formatting new cases added # After Submitting
This commit is contained in:
@ -275,12 +275,30 @@ fn dotnu_completions() {
|
||||
|
||||
// Test nested nu script
|
||||
#[cfg(windows)]
|
||||
let completion_str = "use .\\dir_module\\sub_module\\".to_string();
|
||||
let completion_str = "use `.\\dir_module\\".to_string();
|
||||
#[cfg(not(windows))]
|
||||
let completion_str = "use ./dir_module/sub_module/".to_string();
|
||||
let completion_str = "use `./dir_module/".to_string();
|
||||
let suggestions = completer.complete(&completion_str, completion_str.len());
|
||||
|
||||
match_suggestions(&vec!["sub.nu".into()], &suggestions);
|
||||
match_suggestions(
|
||||
&vec![
|
||||
"mod.nu".into(),
|
||||
#[cfg(windows)]
|
||||
"sub module\\`".into(),
|
||||
#[cfg(not(windows))]
|
||||
"sub module/`".into(),
|
||||
],
|
||||
&suggestions,
|
||||
);
|
||||
|
||||
// Test nested nu script, with ending '`'
|
||||
#[cfg(windows)]
|
||||
let completion_str = "use `.\\dir_module\\sub module\\`".to_string();
|
||||
#[cfg(not(windows))]
|
||||
let completion_str = "use `./dir_module/sub module/`".to_string();
|
||||
let suggestions = completer.complete(&completion_str, completion_str.len());
|
||||
|
||||
match_suggestions(&vec!["sub.nu`".into()], &suggestions);
|
||||
|
||||
let expected = vec![
|
||||
"asdf.nu".into(),
|
||||
|
Reference in New Issue
Block a user