Skip to content

Commit 6c21627

Browse files
committed
Fix literal_string test on rustc older than 1.61
1 parent 5d3e58b commit 6c21627

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ fn literal_string() {
115115
assert_eq!(Literal::string("foo").to_string(), "\"foo\"");
116116
assert_eq!(Literal::string("\"").to_string(), "\"\\\"\"");
117117
assert_eq!(Literal::string("didn't").to_string(), "\"didn't\"");
118-
assert_eq!(
119-
Literal::string("a\00b\07c\08d\0e\0").to_string(),
120-
"\"a\\x000b\\x007c\\08d\\0e\\0\"",
121-
);
118+
119+
let repr = Literal::string("a\00b\07c\08d\0e\0").to_string();
120+
if repr != "\"a\\x000b\\x007c\\u{0}8d\\u{0}e\\u{0}\"" {
121+
assert_eq!(repr, "\"a\\x000b\\x007c\\08d\\0e\\0\"");
122+
}
122123
}
123124

124125
#[test]

0 commit comments

Comments
 (0)