diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests/regression.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/regression.rs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs index aa37326df..d806e0ffb 100644 --- a/crates/ra_hir_ty/src/tests/regression.rs +++ b/crates/ra_hir_ty/src/tests/regression.rs | |||
@@ -1,10 +1,7 @@ | |||
1 | use insta::assert_snapshot; | 1 | use insta::assert_snapshot; |
2 | use ra_db::fixture::WithFixture; | ||
3 | use test_utils::mark; | 2 | use test_utils::mark; |
4 | 3 | ||
5 | use crate::test_db::TestDB; | 4 | use super::{check_types, infer}; |
6 | |||
7 | use super::infer; | ||
8 | 5 | ||
9 | #[test] | 6 | #[test] |
10 | fn bug_484() { | 7 | fn bug_484() { |
@@ -404,13 +401,13 @@ fn test() { | |||
404 | 401 | ||
405 | #[test] | 402 | #[test] |
406 | fn issue_2683_chars_impl() { | 403 | fn issue_2683_chars_impl() { |
407 | let (db, pos) = TestDB::with_position( | 404 | check_types( |
408 | r#" | 405 | r#" |
409 | //- /main.rs crate:main deps:std | 406 | //- /main.rs crate:main deps:std |
410 | fn test() { | 407 | fn test() { |
411 | let chars: std::str::Chars<'_>; | 408 | let chars: std::str::Chars<'_>; |
412 | (chars.next(), chars.nth(1))<|>; | 409 | (chars.next(), chars.nth(1)); |
413 | } | 410 | } //^ (Option<char>, Option<char>) |
414 | 411 | ||
415 | //- /std.rs crate:std | 412 | //- /std.rs crate:std |
416 | #[prelude_import] | 413 | #[prelude_import] |
@@ -449,15 +446,12 @@ pub mod str { | |||
449 | } | 446 | } |
450 | "#, | 447 | "#, |
451 | ); | 448 | ); |
452 | |||
453 | assert_eq!("(Option<char>, Option<char>)", super::type_at_pos(&db, pos)); | ||
454 | } | 449 | } |
455 | 450 | ||
456 | #[test] | 451 | #[test] |
457 | fn issue_3642_bad_macro_stackover() { | 452 | fn issue_3642_bad_macro_stackover() { |
458 | let (db, pos) = TestDB::with_position( | 453 | check_types( |
459 | r#" | 454 | r#" |
460 | //- /main.rs | ||
461 | #[macro_export] | 455 | #[macro_export] |
462 | macro_rules! match_ast { | 456 | macro_rules! match_ast { |
463 | (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) }; | 457 | (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) }; |
@@ -472,7 +466,8 @@ macro_rules! match_ast { | |||
472 | } | 466 | } |
473 | 467 | ||
474 | fn main() { | 468 | fn main() { |
475 | let anchor<|> = match_ast! { | 469 | let anchor = match_ast! { |
470 | //^ () | ||
476 | match parent { | 471 | match parent { |
477 | as => {}, | 472 | as => {}, |
478 | _ => return None | 473 | _ => return None |
@@ -480,8 +475,6 @@ fn main() { | |||
480 | }; | 475 | }; |
481 | }"#, | 476 | }"#, |
482 | ); | 477 | ); |
483 | |||
484 | assert_eq!("()", super::type_at_pos(&db, pos)); | ||
485 | } | 478 | } |
486 | 479 | ||
487 | #[test] | 480 | #[test] |