Add regression tests

This commit is contained in:
Ryo Yoshida 2023-02-05 20:02:16 +09:00
parent 0ec2911857
commit a4d0b5c522
No known key found for this signature in database
GPG key ID: E25698A930586171
2 changed files with 90 additions and 2 deletions

View file

@ -131,3 +131,33 @@ fn main() {}
"#]],
)
}
#[test]
fn issue_13836_str() {
check(
r#"
//- proc_macros: shorten
fn main() {
let s = proc_macros::shorten!("text.$0");
}
"#,
expect![[r#""#]],
)
}
#[test]
fn issue_13836_ident() {
check(
r#"
//- proc_macros: shorten
struct S;
impl S {
fn foo(&self) {}
}
fn main() {
let s = proc_macros::shorten!(S.fo$0);
}
"#,
expect![[r#""#]],
)
}