From 7ba5482a04e2534890b85cf832616a08c1b1bf21 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 16 Jun 2021 22:26:46 +0300 Subject: internal: switch some tests to minicore --- crates/ide_assists/src/handlers/generate_deref.rs | 27 ++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'crates/ide_assists') diff --git a/crates/ide_assists/src/handlers/generate_deref.rs b/crates/ide_assists/src/handlers/generate_deref.rs index 4998ff7a4..4e10fdb85 100644 --- a/crates/ide_assists/src/handlers/generate_deref.rs +++ b/crates/ide_assists/src/handlers/generate_deref.rs @@ -182,23 +182,17 @@ impl std::ops::Deref for B { ); } - fn check_not_applicable(ra_fixture: &str) { - let fixture = format!( - "//- /main.rs crate:main deps:core,std\n{}\n{}", - ra_fixture, - FamousDefs::FIXTURE - ); - check_assist_not_applicable(generate_deref, &fixture) - } - #[test] fn test_generate_record_deref_not_applicable_if_already_impl() { cov_mark::check!(test_add_record_deref_impl_already_exists); - check_not_applicable( - r#"struct A { } + check_assist_not_applicable( + generate_deref, + r#" +//- minicore: deref +struct A { } struct B { $0a: A } -impl std::ops::Deref for B { +impl core::ops::Deref for B { type Target = A; fn deref(&self) -> &Self::Target { @@ -211,11 +205,14 @@ impl std::ops::Deref for B { #[test] fn test_generate_field_deref_not_applicable_if_already_impl() { cov_mark::check!(test_add_field_deref_impl_already_exists); - check_not_applicable( - r#"struct A { } + check_assist_not_applicable( + generate_deref, + r#" +//- minicore: deref +struct A { } struct B($0A) -impl std::ops::Deref for B { +impl core::ops::Deref for B { type Target = A; fn deref(&self) -> &Self::Target { -- cgit v1.2.3