Skip to content

Commit

Permalink
fix json test on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Jan 13, 2022
1 parent 6535633 commit e663405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tracing-subscriber/src/fmt/format/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ mod test {
.join("src")
.join("fmt")
.join("format")
.join("json.rs");
.join("json.rs")
.to_str()
.expect("path must be valid unicode")
// escape windows backslashes
.replace('\\', "\\\\");
let expected =
&format!("{}{}{}",
"{\"timestamp\":\"fake time\",\"level\":\"INFO\",\"span\":{\"answer\":42,\"name\":\"json_span\",\"number\":3},\"spans\":[{\"answer\":42,\"name\":\"json_span\",\"number\":3}],\"target\":\"tracing_subscriber::fmt::format::json::test\",\"filename\":\"",
Expand Down

0 comments on commit e663405

Please sign in to comment.