summaryrefslogtreecommitdiff
path: root/dhall/src/tests.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-14 19:59:50 +0200
committerNadrieril2019-04-14 19:59:50 +0200
commit8e5c1ca7df24653ccb02050f8b167673536f2f42 (patch)
treeffe1bcb6d7c3ada0ee923c4054f818a99e5fc297 /dhall/src/tests.rs
parent1ac24d88ecd2001dc49688afcf6f93944ff60e96 (diff)
Add import tests
Closes #71
Diffstat (limited to '')
-rw-r--r--dhall/src/tests.rs12
1 files changed, 12 insertions, 0 deletions
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)?