aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/regression.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/tests/regression.rs')
-rw-r--r--crates/ra_hir_ty/src/tests/regression.rs21
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 @@
1use insta::assert_snapshot; 1use insta::assert_snapshot;
2use ra_db::fixture::WithFixture;
3use test_utils::mark; 2use test_utils::mark;
4 3
5use crate::test_db::TestDB; 4use super::{check_types, infer};
6
7use super::infer;
8 5
9#[test] 6#[test]
10fn bug_484() { 7fn bug_484() {
@@ -404,13 +401,13 @@ fn test() {
404 401
405#[test] 402#[test]
406fn issue_2683_chars_impl() { 403fn 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
410fn test() { 407fn 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]
457fn issue_3642_bad_macro_stackover() { 452fn 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]
462macro_rules! match_ast { 456macro_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
474fn main() { 468fn 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]