mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
Add more tests.
Add tests for control flows and `let`.
This commit is contained in:
parent
a7df61f1d3
commit
370ba94ca2
1 changed files with 20 additions and 0 deletions
|
@ -541,6 +541,26 @@ fn main() {
|
|||
r#"fn main() { loop { foo }.$0 }"#,
|
||||
r#"fn main() { unsafe { loop { foo } } }"#,
|
||||
);
|
||||
check_edit(
|
||||
"unsafe",
|
||||
r#"fn main() { if true {}.$0 }"#,
|
||||
r#"fn main() { unsafe { if true {} } }"#,
|
||||
);
|
||||
check_edit(
|
||||
"unsafe",
|
||||
r#"fn main() { while true {}.$0 }"#,
|
||||
r#"fn main() { unsafe { while true {} } }"#,
|
||||
);
|
||||
check_edit(
|
||||
"unsafe",
|
||||
r#"fn main() { for i in 0..10 {}.$0 }"#,
|
||||
r#"fn main() { unsafe { for i in 0..10 {} } }"#,
|
||||
);
|
||||
check_edit(
|
||||
"unsafe",
|
||||
r#"fn main() { let x = if true {1} else {2}.$0 }"#,
|
||||
r#"fn main() { let x = unsafe { if true {1} else {2} } }"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue