Skip to content

Commit 04c06b4

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/rust-analyzer/src/test_runner.rs

+5-1
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)