forked from extern/nushell
Add escapes to 'to nuon' (#4964)
This commit is contained in:
@ -74,6 +74,34 @@ fn to_nuon_bool() {
|
||||
assert_eq!(actual.out, "false");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_nuon_escaping() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
"hello\"world"
|
||||
| to nuon
|
||||
| from nuon
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "hello\"world");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_nuon_escaping2() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
"hello\\world"
|
||||
| to nuon
|
||||
| from nuon
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "hello\\world");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_nuon_negative_int() {
|
||||
let actual = nu!(
|
||||
|
Reference in New Issue
Block a user