Skip to content

Commit 603613a

Browse files
author
Jonas Schievink
committed
Update tests
1 parent 4785162 commit 603613a

File tree

1 file changed

+57
-5
lines changed

1 file changed

+57
-5
lines changed

crates/ide/src/diagnostics.rs

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,13 +622,65 @@ pub struct Foo { pub a: i32, pub b: i32 }
622622
r#"
623623
use a;
624624
use a::{c, d::e};
625+
626+
mod a {
627+
mod c {}
628+
mod d {
629+
mod e {}
630+
}
631+
}
625632
"#,
626633
);
627-
check_fix(r#"use {<|>b};"#, r#"use b;"#);
628-
check_fix(r#"use {b<|>};"#, r#"use b;"#);
629-
check_fix(r#"use a::{c<|>};"#, r#"use a::c;"#);
630-
check_fix(r#"use a::{self<|>};"#, r#"use a;"#);
631-
check_fix(r#"use a::{c, d::{e<|>}};"#, r#"use a::{c, d::e};"#);
634+
check_fix(
635+
r"
636+
mod b {}
637+
use {<|>b};
638+
",
639+
r"
640+
mod b {}
641+
use b;
642+
",
643+
);
644+
check_fix(
645+
r"
646+
mod b {}
647+
use {b<|>};
648+
",
649+
r"
650+
mod b {}
651+
use b;
652+
",
653+
);
654+
check_fix(
655+
r"
656+
mod a { mod c {} }
657+
use a::{c<|>};
658+
",
659+
r"
660+
mod a { mod c {} }
661+
use a::c;
662+
",
663+
);
664+
check_fix(
665+
r"
666+
mod a {}
667+
use a::{self<|>};
668+
",
669+
r"
670+
mod a {}
671+
use a;
672+
",
673+
);
674+
check_fix(
675+
r"
676+
mod a { mod c {} mod d { mod e {} } }
677+
use a::{c, d::{e<|>}};
678+
",
679+
r"
680+
mod a { mod c {} mod d { mod e {} } }
681+
use a::{c, d::e};
682+
",
683+
);
632684
}
633685

634686
#[test]

0 commit comments

Comments
 (0)