Skip to content

Commit

Permalink
Revert "Fix test failure due to quoting change in str's Debug"
Browse files Browse the repository at this point in the history
No longer required as compilers older than 1.56 are not supported.

This reverts commit 51608bb.
  • Loading branch information
dtolnay committed Jul 16, 2023
1 parent 177c700 commit fc8af0d
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
use std::iter;
use std::panic;
use std::str::{self, FromStr};

#[test]
Expand Down Expand Up @@ -90,24 +89,9 @@ fn lifetime_number() {
}

#[test]
#[should_panic(expected = r#""'a#" is not a valid Ident"#)]
fn lifetime_invalid() {
let result = panic::catch_unwind(|| Ident::new("'a#", Span::call_site()));
match result {
Err(box_any) => {
let message = box_any.downcast_ref::<String>().unwrap();
let expected1 = r#""\'a#" is not a valid Ident"#; // 1.31.0 .. 1.53.0
let expected2 = r#""'a#" is not a valid Ident"#; // 1.53.0 ..
assert!(
message == expected1 || message == expected2,
"panic message does not match expected string\n\
\x20 panic message: `{:?}`\n\
\x20expected message: `{:?}`",
message,
expected2,
);
}
Ok(_) => panic!("test did not panic as expected"),
}
Ident::new("'a#", Span::call_site());
}

#[test]
Expand Down

0 comments on commit fc8af0d

Please sign in to comment.