Skip to content

Commit 3bc69f3

Browse files
committed
Item movers need some fixes
Fixes rust-lang#8492
1 parent 05fc97e commit 3bc69f3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

crates/ide/src/move_item.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,48 @@ fn main() {}
465465
);
466466
}
467467

468+
#[test]
469+
fn test_move_fn_up() {
470+
check(
471+
r#"
472+
fn main() {
473+
println!("Hello, world!");
474+
}
475+
476+
fn hi$0$0(arg: usize) {}
477+
"#,
478+
expect![[r#"
479+
fn hi$0(arg: usize) {}
480+
481+
fn main() {
482+
println!("Hello, world!");
483+
}
484+
"#]],
485+
Direction::Up,
486+
);
487+
}
488+
489+
#[test]
490+
fn test_move_fn_down() {
491+
check(
492+
r#"
493+
fn hi$0$0(arg: usize) {}
494+
495+
fn main() {
496+
println!("Hello, world!");
497+
}
498+
"#,
499+
expect![[r#"
500+
fn main() {
501+
println!("Hello, world!");
502+
}
503+
504+
fn hi$0(arg: usize) {}
505+
"#]],
506+
Direction::Down,
507+
);
508+
}
509+
468510
#[test]
469511
fn test_move_impl_up() {
470512
check(

0 commit comments

Comments
 (0)