From 8e5c1ca7df24653ccb02050f8b167673536f2f42 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 14 Apr 2019 19:59:50 +0200 Subject: Add import tests Closes #71 --- dhall/src/tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dhall/src/tests.rs') diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 4343341..4a69050 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -38,6 +38,7 @@ use std::path::PathBuf; #[derive(Copy, Clone)] pub enum Feature { Parser, + Import, Normalization, Typecheck, TypeInference, @@ -85,6 +86,7 @@ pub fn run_test( use self::Status::*; let feature_prefix = match feature { Parser => "parser/", + Import => "import/", Normalization => "normalization/", Typecheck => "typecheck/", TypeInference => "type-inference/", @@ -126,6 +128,11 @@ pub fn run_test( match feature { Parser => unreachable!(), + Import => { + // Not sure whether to normalize or not + let expr = expr.skip_typecheck().skip_normalize(); + assert_eq_display!(expr, expected); + } Typecheck => { expr.typecheck_with(&expected.into_type())?; } @@ -150,6 +157,11 @@ pub fn run_test( e => panic!("Expected parse error, got: {:?}", e), } } + Import => { + parse_file_str(&file_path)? + .resolve() + .unwrap_err(); + } Normalization => unreachable!(), Typecheck | TypeInference => { parse_file_str(&file_path)? -- cgit v1.2.3