to json -r not removing whitespaces fix (#11948)

fixes #11900  

# Description
Use `serde_json` instead.

# User-Facing Changes
The problem described in the issue now no longer persists.

No whitespace in the output of `to json --raw`
Output of unicode escape changed to consistent `\uffff`

# Tests + Formatting
I corrected all Tests that were affected by this change.
This commit is contained in:
dannou812
2024-03-20 22:14:31 +01:00
committed by GitHub
parent fdf7f28d07
commit 8237d15683
13 changed files with 45 additions and 34 deletions

View File

@ -62,7 +62,7 @@ fn ls_sort_by_name_sensitive() {
"
));
let json_output = r#"[{"name": "B.txt"},{"name": "C"},{"name": "a.txt"}]"#;
let json_output = r#"[{"name":"B.txt"},{"name":"C"},{"name":"a.txt"}]"#;
assert_eq!(actual.out, json_output);
}
@ -79,7 +79,7 @@ fn ls_sort_by_name_insensitive() {
"
));
let json_output = r#"[{"name": "a.txt"},{"name": "B.txt"},{"name": "C"}]"#;
let json_output = r#"[{"name":"a.txt"},{"name":"B.txt"},{"name":"C"}]"#;
assert_eq!(actual.out, json_output);
}
@ -95,7 +95,7 @@ fn ls_sort_by_type_name_sensitive() {
"
));
let json_output = r#"[{"name": "C","type": "Dir"},{"name": "B.txt","type": "File"},{"name": "a.txt","type": "File"}]"#;
let json_output = r#"[{"name":"C","type":"Dir"},{"name":"B.txt","type":"File"},{"name":"a.txt","type":"File"}]"#;
assert_eq!(actual.out, json_output);
}
@ -111,7 +111,7 @@ fn ls_sort_by_type_name_insensitive() {
"
));
let json_output = r#"[{"name": "C","type": "Dir"},{"name": "a.txt","type": "File"},{"name": "B.txt","type": "File"}]"#;
let json_output = r#"[{"name":"C","type":"Dir"},{"name":"a.txt","type":"File"},{"name":"B.txt","type":"File"}]"#;
assert_eq!(actual.out, json_output);
}