mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 12:25:05 +00:00
Added failing tests
This commit is contained in:
parent
6ddcdb8b29
commit
63751d1c6b
1 changed files with 21 additions and 0 deletions
|
@ -126,4 +126,25 @@ fn foo(n: usize) {
|
||||||
"dbg!(n.checked_sub(4))",
|
"dbg!(n.checked_sub(4))",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn remove_dbg_leave_semicolon() {
|
||||||
|
// https://github.com/rust-analyzer/rust-analyzer/issues/5129#issuecomment-651399779
|
||||||
|
// not quite though
|
||||||
|
let code = "
|
||||||
|
let res = <|>dbg!(1 * 20); // needless comment
|
||||||
|
";
|
||||||
|
let expected = "
|
||||||
|
let res = 1 * 20; // needless comment
|
||||||
|
";
|
||||||
|
check_assist(remove_dbg, code, expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn remove_dbg_keep_expression() {
|
||||||
|
let code = "
|
||||||
|
let res = <|>dbg!(a + b).foo();";
|
||||||
|
let expected = "let res = (a + b).foo();";
|
||||||
|
check_assist(remove_dbg, code, expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue