Skip to content

Commit fc8af0d

Browse files
committed
Revert "Fix test failure due to quoting change in str's Debug"
No longer required as compilers older than 1.56 are not supported. This reverts commit 51608bb.
1 parent 177c700 commit fc8af0d

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

tests/test.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
99
use std::iter;
10-
use std::panic;
1110
use std::str::{self, FromStr};
1211

1312
#[test]
@@ -90,24 +89,9 @@ fn lifetime_number() {
9089
}
9190

9291
#[test]
92+
#[should_panic(expected = r#""'a#" is not a valid Ident"#)]
9393
fn lifetime_invalid() {
94-
let result = panic::catch_unwind(|| Ident::new("'a#", Span::call_site()));
95-
match result {
96-
Err(box_any) => {
97-
let message = box_any.downcast_ref::<String>().unwrap();
98-
let expected1 = r#""\'a#" is not a valid Ident"#; // 1.31.0 .. 1.53.0
99-
let expected2 = r#""'a#" is not a valid Ident"#; // 1.53.0 ..
100-
assert!(
101-
message == expected1 || message == expected2,
102-
"panic message does not match expected string\n\
103-
\x20 panic message: `{:?}`\n\
104-
\x20expected message: `{:?}`",
105-
message,
106-
expected2,
107-
);
108-
}
109-
Ok(_) => panic!("test did not panic as expected"),
110-
}
94+
Ident::new("'a#", Span::call_site());
11195
}
11296

11397
#[test]

0 commit comments

Comments
 (0)