Skip to content

Commit 4e8e251

Browse files
committed
add non-functioning test
1 parent 7cb0bb8 commit 4e8e251

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

crates/ide-completion/src/tests/flyimport.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,57 @@ fn main() {
374374
);
375375
}
376376

377+
#[test]
378+
fn trait_method_fuzzy_completion_aware_of_fundamental_traits() {
379+
let fixture = r#"
380+
//- /std.rs crate:std
381+
pub mod boxed {
382+
#[lang = "owned_box"]
383+
#[fundamental]
384+
pub struct Box<T>(T);
385+
}
386+
387+
//- /trait-dep.rs crate:trait-dep deps:std
388+
pub trait TestTrait {
389+
fn some_method(&self) -> Result;
390+
}
391+
392+
//- /lib.rs crate:dep deps:std,trait-dep
393+
pub struct TestStruct;
394+
395+
impl<T> trait_dep::TestTrait for TestStruct {
396+
fn some_method(&self) -> Result {
397+
todo!()
398+
}
399+
}
400+
401+
//- /main.rs crate:main deps:dep,trait-dep,std
402+
use dep::TestStruct;
403+
use std::boxed::Box;
404+
405+
fn main() {
406+
let test_struct = TestStruct;
407+
test_struct.$0
408+
}
409+
"#;
410+
411+
check(fixture, expect!["some_method"]);
412+
413+
check_edit(
414+
"fmt",
415+
fixture,
416+
r#"
417+
use dep::TestStruct;
418+
use std::boxed::Box;
419+
420+
fn main() {
421+
let test_struct = Box::new(TestStruct);
422+
test_struct.fmt()$0
423+
}
424+
"#,
425+
);
426+
}
427+
377428
#[test]
378429
fn trait_method_from_alias() {
379430
let fixture = r#"

0 commit comments

Comments
 (0)