Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index f4b1039024..6cb323b46a 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs @@ -1601,3 +1601,51 @@ async fn get_double_async(num: u32) -> u32 { false, ); } + +#[test] +fn private_multi_namespace() { + check_highlighting( + r#" +//- /bar.rs crate:bar deps:foo +use foo::foo; + +//- /foo.rs crate:foo +struct foo; + +#[macro_export] +macro_rules! foo { + () => {}; +} + "#, + expect_file!["./test_data/private_multi_namespace.html"], + false, + ); +} + +#[test] +fn mod_and_macro_name_conflict() { + check_highlighting( + r#" +//- /main.rs crate:main deps:foo +use foo::bar; + +fn main() { + bar!() +} + +//- /foo.rs crate:foo +mod bar { + fn random() {} +} + +#[macro_export] +macro_rules! bar { + () => { + println!("Hello"); + }; +} +"#, + expect_file!["./test_data/highlight_module_macro_conflict.html"], + false, + ); +} |