[Stylistic/non-functional] Use an r# format string to make json easier to read (#1299)

This commit is contained in:
Hannes Käufler 2022-12-20 18:55:21 +01:00 committed by GitHub
parent a61126ab23
commit 468ffd29fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 6 deletions

View File

@ -55,12 +55,33 @@ fn test_stdin_json() -> Result<()> {
.failure(); .failure();
assert_eq!( assert_eq!(
str::from_utf8(&output.get_output().stdout)?, str::from_utf8(&output.get_output().stdout)?,
"[\n {\n \"code\": \"F401\",\n \"message\": \"`os` imported but unused\",\n \ r#"[
\"fix\": {\n \"content\": \"\",\n \"location\": {\n \"row\": 1,\n \ {
\"column\": 0\n },\n \"end_location\": {\n \"row\": 2,\n \ "code": "F401",
\"column\": 0\n }\n },\n \"location\": {\n \"row\": 1,\n \ "message": "`os` imported but unused",
\"column\": 8\n },\n \"end_location\": {\n \"row\": 1,\n \"column\": \ "fix": {
10\n },\n \"filename\": \"F401.py\"\n }\n]\n" "content": "",
"location": {
"row": 1,
"column": 0
},
"end_location": {
"row": 2,
"column": 0
}
},
"location": {
"row": 1,
"column": 8
},
"end_location": {
"row": 1,
"column": 10
},
"filename": "F401.py"
}
]
"#
); );
Ok(()) Ok(())
} }