Skip to content

Commit

Permalink
add test case with marco reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Jan 18, 2024
1 parent bd26403 commit 0bf986d
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,45 @@ mod tests {

use super::*;

#[test]
fn test_with_marco() {
check_assist(
extract_struct_from_enum_variant,
r#"
macro_rules! foo {
($x:expr) => {
$x
};
}
enum TheEnum {
TheVariant$0 { the_field: u8 },
}
fn main() {
foo![TheEnum::TheVariant { the_field: 42 }];
}
"#,
r#"
macro_rules! foo {
($x:expr) => {
$x
};
}
struct TheVariant{ the_field: u8 }
enum TheEnum {
TheVariant(TheVariant),
}
fn main() {
foo![TheEnum::TheVariant { the_field: 42 }];
}
"#,
);
}

#[test]
fn issue_16197() {
check_assist(
Expand Down

0 comments on commit 0bf986d

Please sign in to comment.