From 603613a3028d7d385195f03f626ce00e1968191e Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 16 Sep 2020 17:24:34 +0200 Subject: Update tests --- crates/ide/src/diagnostics.rs | 62 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index b2b972b02..dc815a483 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs @@ -622,13 +622,65 @@ pub struct Foo { pub a: i32, pub b: i32 } r#" use a; use a::{c, d::e}; + +mod a { + mod c {} + mod d { + mod e {} + } +} "#, ); - check_fix(r#"use {<|>b};"#, r#"use b;"#); - check_fix(r#"use {b<|>};"#, r#"use b;"#); - check_fix(r#"use a::{c<|>};"#, r#"use a::c;"#); - check_fix(r#"use a::{self<|>};"#, r#"use a;"#); - check_fix(r#"use a::{c, d::{e<|>}};"#, r#"use a::{c, d::e};"#); + check_fix( + r" + mod b {} + use {<|>b}; + ", + r" + mod b {} + use b; + ", + ); + check_fix( + r" + mod b {} + use {b<|>}; + ", + r" + mod b {} + use b; + ", + ); + check_fix( + r" + mod a { mod c {} } + use a::{c<|>}; + ", + r" + mod a { mod c {} } + use a::c; + ", + ); + check_fix( + r" + mod a {} + use a::{self<|>}; + ", + r" + mod a {} + use a; + ", + ); + check_fix( + r" + mod a { mod c {} mod d { mod e {} } } + use a::{c, d::{e<|>}}; + ", + r" + mod a { mod c {} mod d { mod e {} } } + use a::{c, d::e}; + ", + ); } #[test] -- cgit v1.2.3