aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-14 11:41:29 +0000
committerGitHub <[email protected]>2021-01-14 11:41:29 +0000
commit947850c2d9e2fa832516e3486efa0dd9c4d30e73 (patch)
tree1058398a33d4d737536cfce10de9871936207432 /crates
parente732b948e9d7a32b644a45cd0a67ff9514879ece (diff)
parentdd5b3cd6f08ece075d1e3ad7c456b1eb7d289d88 (diff)
Merge #7265
7265: Add a test for #7110 r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-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#"