diff options
Diffstat (limited to '')
-rw-r--r-- | dhall/src/tests.rs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index dede639..6b1c426 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -31,9 +31,6 @@ macro_rules! make_spec_test { use crate::error::{Error, Result}; use crate::expr::Parsed; -use crate::*; -use dhall_core::*; -use dhall_generator as dhall; use std::path::PathBuf; #[allow(dead_code)] @@ -47,11 +44,6 @@ pub enum Feature { TypeInferenceFailure, } -// Deprecated -fn read_dhall_file<'i>(file_path: &str) -> Result<SubExpr<X, X>> { - crate::imports::load_dhall_file(&PathBuf::from(file_path)) -} - fn parse_file_str<'i>(file_path: &str) -> Result<Parsed> { Parsed::parse_file(&PathBuf::from(file_path)) } @@ -134,11 +126,18 @@ pub fn run_test(base_path: &str, feature: Feature) { .spawn(|| { let expr_file_path = base_path.clone() + "A.dhall"; let expected_file_path = base_path + "B.dhall"; - let expr = read_dhall_file(&expr_file_path).unwrap(); - let expected = - read_dhall_file(&expected_file_path).unwrap(); - typecheck::type_of(dhall::subexpr!(expr: expected)) + let expr = parse_file_str(&expr_file_path) + .unwrap() + .resolve() .unwrap(); + let expected = parse_file_str(&expected_file_path) + .unwrap() + .resolve() + .unwrap() + .skip_typecheck() + .skip_normalize() + .into_type(); + expr.typecheck_with(&expected).unwrap(); }) .unwrap() .join() |