mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 08:55:40 +02:00
* fix issue #559: to json -r serializes datetime without spaces * add in a third test which checks spaces in both keys and values * fix clippy error
This commit is contained in:
@ -15,9 +15,25 @@ fn from_json_2() -> TestResult {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_json_raw_flag() -> TestResult {
|
||||
fn to_json_raw_flag_1() -> TestResult {
|
||||
run_test(
|
||||
"[[a b]; [jim susie] [3 4]] | to json -r",
|
||||
r#"[{"a":"jim","b":"susie"},{"a":3,"b":4}]"#,
|
||||
r#"[{"a": "jim","b": "susie"},{"a": 3,"b": 4}]"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_json_raw_flag_2() -> TestResult {
|
||||
run_test(
|
||||
"[[\"a b\" c]; [jim susie] [3 4]] | to json -r",
|
||||
r#"[{"a b": "jim","c": "susie"},{"a b": 3,"c": 4}]"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_json_raw_flag_3() -> TestResult {
|
||||
run_test(
|
||||
"[[\"a b\" \"c d\"]; [\"jim smith\" \"susie roberts\"] [3 4]] | to json -r",
|
||||
r#"[{"a b": "jim smith","c d": "susie roberts"},{"a b": 3,"c d": 4}]"#,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user