forked from extern/nushell
Improve external quoting logic (#3579)
* Add tests and improve quoting logic * fmt * Fix clippy ling * Fix clippy ling
This commit is contained in:
@ -199,7 +199,8 @@ mod stdin_evaluation {
|
||||
|
||||
mod external_words {
|
||||
use super::nu;
|
||||
|
||||
use nu_test_support::fs::Stub::FileWithContent;
|
||||
use nu_test_support::{pipeline, playground::Playground};
|
||||
#[test]
|
||||
fn relaxed_external_words() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
@ -217,6 +218,27 @@ mod external_words {
|
||||
|
||||
assert_eq!(actual.out, "test \"things\"");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn external_arg_with_quotes() {
|
||||
Playground::setup("external_arg_with_quotes", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![FileWithContent(
|
||||
"sample.toml",
|
||||
r#"
|
||||
nu_party_venue = "zion"
|
||||
"#,
|
||||
)]);
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
nu --testbin meow "sample.toml" | from toml | get nu_party_venue
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "zion");
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
mod nu_commands {
|
||||
|
Reference in New Issue
Block a user