aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/completions
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-14 11:33:02 +0000
committerAleksey Kladov <[email protected]>2021-01-14 11:33:02 +0000
commitdd5b3cd6f08ece075d1e3ad7c456b1eb7d289d88 (patch)
tree9b5c1c0a722f5626d15d414506977fb9494e1781 /crates/completion/src/completions
parentd76143da19fcfcd210acc930e68acd6c43db9088 (diff)
Add a test for #7110
Diffstat (limited to 'crates/completion/src/completions')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index 12cdb869d..7ba99447d 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -517,6 +517,37 @@ mod prelude { struct Option; }
517 } 517 }
518 518
519 #[test] 519 #[test]
520 fn completes_prelude_macros() {
521 check(
522 r#"
523//- /main.rs crate:main deps:std
524fn f() {$0}
525
526//- /std/lib.rs crate:std
527#[prelude_import]
528pub use prelude::*;
529
530#[macro_use]
531mod prelude {
532 pub use crate::concat;
533}
534
535mod macros {
536 #[rustc_builtin_macro]
537 #[macro_export]
538 macro_rules! concat { }
539}
540"#,
541 expect![[r##"
542 fn f() fn f()
543 ma concat!(…) #[macro_export]
544 macro_rules! concat
545 md std
546 "##]],
547 );
548 }
549
550 #[test]
520 fn completes_std_prelude_if_core_is_defined() { 551 fn completes_std_prelude_if_core_is_defined() {
521 check( 552 check(
522 r#" 553 r#"