summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2020-02-09 18:35:16 +0000
committerNadrieril2020-02-09 19:58:28 +0000
commit02cacfd0360a0acea959c5a9b6d1b7fb0241db81 (patch)
tree60843db65ccac0d69c27e5d3bb5f23f0e35837e1
parent5d0f37d89f23512c2676b1f2d0235f25269c53ab (diff)
Remove distinction between failure and error tests
-rw-r--r--dhall/build.rs28
-rw-r--r--dhall/src/tests.rs16
2 files changed, 4 insertions, 40 deletions
diff --git a/dhall/build.rs b/dhall/build.rs
index 67f11e2..552966b 100644
--- a/dhall/build.rs
+++ b/dhall/build.rs
@@ -267,22 +267,6 @@ fn generate_tests() -> std::io::Result<()> {
|| path == "customHeadersUsingBoundVariable"
}),
input_type: FileType::Text,
- output_type: None,
- },
- TestFeature {
- module_name: "import_error",
- directory: "import/failure/",
- variant: "ImportError",
- path_filter: Box::new(|path: &str| {
- false
- || path == "alternativeEnv"
- || path == "alternativeEnvMissing"
- || path == "hashMismatch"
- || path == "missing"
- || path == "referentiallyInsane"
- || path == "customHeadersUsingBoundVariable"
- }),
- input_type: FileType::Text,
output_type: Some(FileType::UI),
},
TestFeature {
@@ -355,18 +339,6 @@ fn generate_tests() -> std::io::Result<()> {
|| path == "unit/MergeHandlerFreeVar"
}),
input_type: FileType::Text,
- output_type: None,
- },
- TestFeature {
- module_name: "type_error",
- directory: "type-inference/failure/",
- variant: "TypeError",
- path_filter: Box::new(|path: &str| {
- false
- // TODO: enable free variable checking
- || path == "unit/MergeHandlerFreeVar"
- }),
- input_type: FileType::Text,
output_type: Some(FileType::UI),
},
];
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs
index 366ba32..19e5264 100644
--- a/dhall/src/tests.rs
+++ b/dhall/src/tests.rs
@@ -61,11 +61,9 @@ enum Test {
BinaryDecodingSuccess(TestFile, TestFile),
BinaryDecodingFailure(TestFile),
ImportSuccess(TestFile, TestFile),
- ImportFailure(TestFile),
- ImportError(TestFile, TestFile),
+ ImportFailure(TestFile, TestFile),
TypeInferenceSuccess(TestFile, TestFile),
- TypeInferenceFailure(TestFile),
- TypeError(TestFile, TestFile),
+ TypeInferenceFailure(TestFile, TestFile),
Normalization(TestFile, TestFile),
AlphaNormalization(TestFile, TestFile),
}
@@ -277,10 +275,7 @@ fn run_test(test: Test) -> Result<()> {
let expr = expr.normalize()?;
expected.compare(expr)?;
}
- ImportFailure(expr) => {
- expr.parse()?.resolve().unwrap_err();
- }
- ImportError(expr, expected) => {
+ ImportFailure(expr, expected) => {
let err = expr.parse()?.resolve().unwrap_err();
expected.compare_ui(err)?;
}
@@ -288,10 +283,7 @@ fn run_test(test: Test) -> Result<()> {
let ty = expr.resolve()?.typecheck()?.get_type()?;
expected.compare(ty)?;
}
- TypeInferenceFailure(expr) => {
- expr.resolve()?.typecheck().unwrap_err();
- }
- TypeError(expr, expected) => {
+ TypeInferenceFailure(expr, expected) => {
let err = expr.resolve()?.typecheck().unwrap_err();
expected.compare_ui(err)?;
}