From bbc4dc995612916a4c0a99396b5259a5fb1dda80 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 29 Jun 2020 17:22:47 +0200 Subject: Update the rest of the tests --- crates/ra_hir_ty/src/tests/regression.rs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'crates/ra_hir_ty/src/tests/regression.rs') 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 @@ use insta::assert_snapshot; -use ra_db::fixture::WithFixture; use test_utils::mark; -use crate::test_db::TestDB; - -use super::infer; +use super::{check_types, infer}; #[test] fn bug_484() { @@ -404,13 +401,13 @@ fn test() { #[test] fn issue_2683_chars_impl() { - let (db, pos) = TestDB::with_position( + check_types( r#" //- /main.rs crate:main deps:std fn test() { let chars: std::str::Chars<'_>; - (chars.next(), chars.nth(1))<|>; -} + (chars.next(), chars.nth(1)); +} //^ (Option, Option) //- /std.rs crate:std #[prelude_import] @@ -449,15 +446,12 @@ pub mod str { } "#, ); - - assert_eq!("(Option, Option)", super::type_at_pos(&db, pos)); } #[test] fn issue_3642_bad_macro_stackover() { - let (db, pos) = TestDB::with_position( + check_types( r#" -//- /main.rs #[macro_export] macro_rules! match_ast { (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) }; @@ -472,7 +466,8 @@ macro_rules! match_ast { } fn main() { - let anchor<|> = match_ast! { + let anchor = match_ast! { + //^ () match parent { as => {}, _ => return None @@ -480,8 +475,6 @@ fn main() { }; }"#, ); - - assert_eq!("()", super::type_at_pos(&db, pos)); } #[test] -- cgit v1.2.3