From 3b6979be77dcce37edd5f29607c5fd41252e312d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 20 Jul 2020 19:38:52 +0300 Subject: Use expect in never_type tests --- crates/ra_hir_ty/src/tests/coercion.rs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'crates/ra_hir_ty/src/tests/coercion.rs') diff --git a/crates/ra_hir_ty/src/tests/coercion.rs b/crates/ra_hir_ty/src/tests/coercion.rs index 7704774b7..823abddc6 100644 --- a/crates/ra_hir_ty/src/tests/coercion.rs +++ b/crates/ra_hir_ty/src/tests/coercion.rs @@ -1,32 +1,7 @@ +use expect::expect; use test_utils::mark; -use expect::{expect, Expect}; - -// Infer with some common definitions and impls. -fn check_infer(ra_fixture: &str, expect: Expect) { - let defs = r#" - #[lang = "sized"] - pub trait Sized {} - #[lang = "unsize"] - pub trait Unsize {} - #[lang = "coerce_unsized"] - pub trait CoerceUnsized {} - - impl<'a, 'b: 'a, T: ?Sized + Unsize, U: ?Sized> CoerceUnsized<&'a U> for &'b T {} - impl, U: ?Sized> CoerceUnsized<*mut U> for *mut T {} - "#; - - // Append to the end to keep positions unchanged. - let mut actual = super::infer(&format!("{}{}", ra_fixture, defs)); - actual.push('\n'); - expect.assert_eq(&actual); -} - -fn check_infer_with_mismatches(ra_fixture: &str, expect: Expect) { - let mut actual = super::infer_with_mismatches(ra_fixture, true); - actual.push('\n'); - expect.assert_eq(&actual); -} +use super::{check_infer, check_infer_with_mismatches}; #[test] fn infer_block_expr_type_mismatch() { -- cgit v1.2.3