Skip to content

Commit

Permalink
libtest: JSON fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilad Naaman committed Dec 12, 2017
1 parent 49b00f6 commit 47f7ff1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/libtest/formatters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {

fn write_run_finish(&mut self, state: &ConsoleTestState) -> io::Result<bool> {

self.write_str(&*format!(r#"{{ "type": "suite",
"event": "{}",
"passed": {},
"failed": {},
"allowed_fail": {},
"ignored": {},
"measured": {},
"filtered_out": "{}" }}"#,
self.write_str(&*format!("{{ \"type\": \"suite\",\
\"event\": \"{}\", \
\"passed\": {}, \
\"failed\": {}, \
\"allowed_fail\": {}, \
\"ignored\": {}, \
\"measured\": {}, \
\"filtered_out\": \"{}\" }}",
if state.failed == 0 { "ok" } else { "failed" },
state.passed,
state.failed + state.allowed_fail,
Expand All @@ -351,7 +351,7 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
let output = naive_json_escape(&*String::from_utf8_lossy(stdout));

self.write_str(
&*format!(r#"{{ "type": "test_output", "name": "{}" "output": "{}" }}"#,
&*format!(r#"{{ "type": "test_output", "name": "{}", "output": "{}" }}"#,
f.name,
output))?;
}
Expand Down

0 comments on commit 47f7ff1

Please sign in to comment.