Skip to content

Commit

Permalink
internal: add auto-import assist tests for raw identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsemakula committed Apr 15, 2024
1 parent e326b63 commit 8e45912
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions crates/ide-assists/src/handlers/auto_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,4 +1620,50 @@ mod foo {
"#,
);
}

#[test]
fn preserve_raw_identifiers_strict() {
check_assist(
auto_import,
r"
r#as$0
pub mod ffi_mod {
pub fn r#as() {};
}
",
r"
use ffi_mod::r#as;
r#as
pub mod ffi_mod {
pub fn r#as() {};
}
",
);
}

#[test]
fn preserve_raw_identifiers_reserved() {
check_assist(
auto_import,
r"
r#abstract$0
pub mod ffi_mod {
pub fn r#abstract() {};
}
",
r"
use ffi_mod::r#abstract;
r#abstract
pub mod ffi_mod {
pub fn r#abstract() {};
}
",
);
}
}

0 comments on commit 8e45912

Please sign in to comment.