Skip to content

Commit c26f175

Browse files
author
duncan
committed
Fix parsing cargo test json output by making stdout and optional field
1 parent d1b9176 commit c26f175

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ pub(crate) enum TestState {
1818
Started,
1919
Ok,
2020
Ignored,
21-
Failed { stdout: String },
21+
Failed {
22+
// the stdout field is not always present depending on cargo test flags
23+
#[serde(skip_serializing_if = "String::is_empty", default)]
24+
stdout: String,
25+
},
2226
}
2327

2428
#[derive(Debug, Deserialize)]

0 commit comments

Comments
 (0)