Skip to content

Commit a78ac95

Browse files
tests: Fix dot test by not including whitespace.
Rust 1.35 changed the behavior of the Debug trait to include the trailing comma in structs and other things. This deals with that by not including all of the whitespace. The Rust change that introduced this was rust-lang/rust#59076 Fixes petgraph#255.
1 parent dcd4956 commit a78ac95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/graph.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,12 +1422,12 @@ fn dot() {
14221422
let mut gr = Graph::new();
14231423
let a = gr.add_node(Record { a: 1, b: r"abc\" });
14241424
gr.add_edge(a, a, (1, 2));
1425-
let dot_output = format!("{:#?}", Dot::new(&gr));
1425+
let dot_output = format!("{:?}", Dot::new(&gr));
14261426
assert_eq!(dot_output,
14271427
// The single \ turns into four \\\\ because of Debug which turns it to \\ and then escaping each \ to \\.
14281428
r#"digraph {
1429-
0 [label="Record {\l a: 1,\l b: \"abc\\\\\"\l}\l"]
1430-
0 -> 0 [label="(\l 1,\l 2\l)\l"]
1429+
0 [label="Record { a: 1, b: \"abc\\\\\" }"]
1430+
0 -> 0 [label="(1, 2)"]
14311431
}
14321432
"#);
14331433
}

0 commit comments

Comments
 (0)