Skip to content

Commit 5766436

Browse files
bors[bot]lnicola
andauthored
Merge #5458
5458: Use expect in some ra_hir_ty tests r=flodiebold a=lnicola Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents 76c1fac + b8e09b7 commit 5766436

File tree

3 files changed

+896
-849
lines changed

3 files changed

+896
-849
lines changed

crates/ra_hir_ty/src/tests.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mod display_source_code;
1010

1111
use std::sync::Arc;
1212

13+
use expect::Expect;
1314
use hir_def::{
1415
body::{BodySourceMap, SyntheticSyntax},
1516
child_by_source::ChildBySource,
@@ -344,3 +345,15 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() {
344345
assert!(!format!("{:?}", events).contains("infer"), "{:#?}", events)
345346
}
346347
}
348+
349+
fn check_infer(ra_fixture: &str, expect: Expect) {
350+
let mut actual = infer(ra_fixture);
351+
actual.push('\n');
352+
expect.assert_eq(&actual);
353+
}
354+
355+
fn check_infer_with_mismatches(ra_fixture: &str, expect: Expect) {
356+
let mut actual = infer_with_mismatches(ra_fixture, true);
357+
actual.push('\n');
358+
expect.assert_eq(&actual);
359+
}

0 commit comments

Comments
 (0)