Soften restrictions for external parameters (#1277)

* Soften restrictions for external parameters

* Add test
This commit is contained in:
Jonathan Turner 2020-01-25 08:14:49 +13:00 committed by GitHub
parent a2bb23d78c
commit 798a24eda5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -1008,8 +1008,7 @@ fn is_boundary(c: Option<char>) -> bool {
fn is_external_word_char(c: char) -> bool {
match c {
';' | '|' | '#' | '-' | '"' | '\'' | '$' | '(' | ')' | '[' | ']' | '{' | '}' | '`'
| '.' => false,
';' | '|' | '"' | '\'' | '$' | '(' | ')' | '[' | ']' | '{' | '}' | '`' => false,
other if other.is_whitespace() => false,
_ => true,
}

View File

@ -78,6 +78,19 @@ mod it_evaluation {
}
}
mod external_words {
use super::nu;
#[test]
fn relaxed_external_words() {
let actual = nu!(cwd: ".", r#"
cococo joturner@foo.bar.baz
"#);
assert_eq!(actual, "joturner@foo.bar.baz");
}
}
mod tilde_expansion {
use super::nu;