From ca93f39201f6f8be9bc1466eed7323d0426e135c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 15:50:58 +0000 Subject: Track output of import errors --- dhall/build.rs | 16 ++++++++++++++++ dhall/src/tests.rs | 26 ++++++++++++++++++++++++++ dhall/tests/errors/import/cycle.txt | 1 + dhall/tests/errors/import/importBoundary.txt | 1 + 4 files changed, 44 insertions(+) create mode 100644 dhall/tests/errors/import/cycle.txt create mode 100644 dhall/tests/errors/import/importBoundary.txt diff --git a/dhall/build.rs b/dhall/build.rs index 83c154e..7733581 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -245,6 +245,22 @@ fn generate_tests() -> std::io::Result<()> { 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: None, + }, TestFeature { module_name: "beta_normalize", directory: "normalization/success/", diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 8136625..449e7ee 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -61,6 +61,7 @@ pub enum Test<'a> { BinaryDecodingFailure(&'a str), ImportSuccess(&'a str, &'a str), ImportFailure(&'a str), + ImportError(&'a str), TypeInferenceSuccess(&'a str, &'a str), TypeInferenceFailure(&'a str), TypeError(&'a str), @@ -157,6 +158,31 @@ pub fn run_test(test: Test<'_>) -> Result<()> { ImportFailure(file_path) => { parse_file_str(&file_path)?.resolve().unwrap_err(); } + // Checks the output of the type error against a text file. If the text file doesn't exist, + // we instead write to it the output we got. This makes it easy to update those files: just + // `rm -r dhall/tests/type-errors` and run the tests again. + ImportError(file_path) => { + let err: Error = + parse_file_str(&file_path)?.resolve().unwrap_err().into(); + let file_path = PathBuf::from(file_path); + let error_file_path = file_path + .strip_prefix("../dhall-lang/tests/import/failure/") + .or_else(|_| file_path.strip_prefix("tests/import/failure/")) + .unwrap(); + let error_file_path = + PathBuf::from("tests/errors/import/").join(error_file_path); + let error_file_path = error_file_path.with_extension("txt"); + + if error_file_path.is_file() { + let expected_msg = std::fs::read_to_string(error_file_path)?; + let msg = format!("{}\n", err); + assert_eq_pretty_str!(msg, expected_msg); + } else { + std::fs::create_dir_all(error_file_path.parent().unwrap())?; + let mut file = File::create(error_file_path)?; + writeln!(file, "{}", err)?; + } + } TypeInferenceSuccess(expr_file_path, expected_file_path) => { let expr = parse_file_str(&expr_file_path)?.resolve()?.typecheck()?; diff --git a/dhall/tests/errors/import/cycle.txt b/dhall/tests/errors/import/cycle.txt new file mode 100644 index 0000000..0a20503 --- /dev/null +++ b/dhall/tests/errors/import/cycle.txt @@ -0,0 +1 @@ +Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Resolve(Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }, Resolve(ImportCycle([Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }], Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }))))) diff --git a/dhall/tests/errors/import/importBoundary.txt b/dhall/tests/errors/import/importBoundary.txt new file mode 100644 index 0000000..8f78e48 --- /dev/null +++ b/dhall/tests/errors/import/importBoundary.txt @@ -0,0 +1 @@ +Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "importBoundary.dhall"] }), hash: None }, Typecheck(TypeError { message: Custom("error: unbound variable `x`\n --> :1:0\n |\n...\n3 | x\n | ^ not found in this scope\n |") })) -- cgit v1.2.3 From 81504a7ee24f22820c6bc85823c879d488710d11 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 17:39:01 +0000 Subject: Massively deduplicate test harness --- dhall/build.rs | 63 +++++--- dhall/src/lib.rs | 11 ++ dhall/src/semantics/tck/typecheck.rs | 5 +- dhall/src/tests.rs | 279 ++++++++++++++++++----------------- 4 files changed, 199 insertions(+), 159 deletions(-) diff --git a/dhall/build.rs b/dhall/build.rs index 7733581..3955b3a 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -2,15 +2,19 @@ use std::env; use std::ffi::OsString; use std::fs::{read_to_string, File}; use std::io::{BufRead, BufReader, Write}; -use std::path::Path; +use std::path::{Path, PathBuf}; use walkdir::WalkDir; use abnf_to_pest::render_rules_to_pest; -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] enum FileType { + /// Dhall source file Text, + /// Dhall binary file Binary, + /// Text file with expected text output + UI, } impl FileType { @@ -18,8 +22,23 @@ impl FileType { match self { FileType::Text => "dhall", FileType::Binary => "dhallb", + FileType::UI => "txt", } } + fn constructor(self) -> &'static str { + match self { + FileType::Text => "TestFile::Source", + FileType::Binary => "TestFile::Binary", + FileType::UI => "TestFile::UI", + } + } + fn construct(self, path: &str) -> String { + // e.g. with + // path = "tests/foor/barA" + // returns something like: + // TestFile::Source("tests/foor/barA.dhall") + format!(r#"{}("{}.{}")"#, self.constructor(), path, self.to_ext()) + } } fn dhall_files_in_dir<'a>( @@ -72,7 +91,8 @@ fn make_test_module( mut feature: TestFeature, ) -> std::io::Result<()> { writeln!(w, "mod {} {{", feature.module_name)?; - let take_ab_suffix = feature.output_type.is_some(); + let take_ab_suffix = feature.output_type.is_some() + && feature.output_type != Some(FileType::UI); for base_path in base_paths { let tests_dir = base_path.join(feature.directory); for (name, path) in @@ -85,22 +105,26 @@ fn make_test_module( let path = path.to_string_lossy(); let test = match feature.output_type { None => { - let input_file = - format!("\"{}.{}\"", path, feature.input_type.to_ext()); - format!("{}({})", feature.variant, input_file) + let input = feature.input_type.construct(&path); + format!("{}({})", feature.variant, input) + } + Some(output_type @ FileType::UI) => { + let input = feature.input_type.construct(&path); + let output_file = PathBuf::from(path.as_ref()) + .strip_prefix(base_path) + .unwrap() + .strip_prefix(feature.directory) + .unwrap() + .to_string_lossy() + .into_owned(); + let output = output_type.construct(&output_file); + format!("{}({}, {})", feature.variant, input, output) } Some(output_type) => { - let input_file = format!( - "\"{}A.{}\"", - path, - feature.input_type.to_ext() - ); - let output_file = - format!("\"{}B.{}\"", path, output_type.to_ext()); - format!( - "{}({}, {})", - feature.variant, input_file, output_file - ) + let input = + feature.input_type.construct(&format!("{}A", path)); + let output = output_type.construct(&format!("{}B", path)); + format!("{}({}, {})", feature.variant, input, output) } }; writeln!(w, "make_spec_test!({}, {});", test, name)?; @@ -259,7 +283,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "customHeadersUsingBoundVariable" }), input_type: FileType::Text, - output_type: None, + output_type: Some(FileType::UI), }, TestFeature { module_name: "beta_normalize", @@ -281,6 +305,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "prelude/JSON/number/1" // TODO: doesn't typecheck || path == "unit/RightBiasedRecordMergeWithinRecordProjection" + || path == "unit/Sort" // // TODO: Further record simplifications || path == "simplifications/rightBiasedMergeWithinRecordProjectionWithinFieldSelection0" || path == "simplifications/rightBiasedMergeWithinRecordProjectionWithinFieldSelection1" @@ -342,7 +367,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/MergeHandlerFreeVar" }), input_type: FileType::Text, - output_type: None, + output_type: Some(FileType::UI), }, ]; diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index dbf1fc0..7725b28 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -234,6 +234,17 @@ impl std::hash::Hash for Normalized { } } +impl From for NormalizedExpr { + fn from(other: Parsed) -> Self { + other.to_expr() + } +} +impl From for NormalizedExpr { + fn from(other: Normalized) -> Self { + other.to_expr() + } +} + impl Eq for Typed {} impl PartialEq for Typed { fn eq(&self, other: &Self) -> bool { diff --git a/dhall/src/semantics/tck/typecheck.rs b/dhall/src/semantics/tck/typecheck.rs index 6817712..dd9a8fa 100644 --- a/dhall/src/semantics/tck/typecheck.rs +++ b/dhall/src/semantics/tck/typecheck.rs @@ -847,7 +847,10 @@ pub(crate) fn type_with( /// Typecheck an expression and return the expression annotated with types if type-checking /// succeeded, or an error if type-checking failed. pub(crate) fn typecheck(e: &Expr) -> Result { - type_with(&TyEnv::new(), e) + let res = type_with(&TyEnv::new(), e)?; + // Ensure that the inferred type exists (i.e. this is not Sort) + res.get_type()?; + Ok(res) } /// Like `typecheck`, but additionally checks that the expression's type matches the provided type. diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 449e7ee..659317f 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -48,51 +48,124 @@ use std::io::{Read, Write}; use std::path::PathBuf; use crate::error::{Error, Result}; -use crate::Parsed; +use crate::syntax::binary; +use crate::{Normalized, NormalizedExpr, Parsed, Resolved}; #[allow(dead_code)] -#[derive(Clone)] -pub enum Test<'a> { - ParserSuccess(&'a str, &'a str), - ParserFailure(&'a str), - Printer(&'a str, &'a str), - BinaryEncoding(&'a str, &'a str), - BinaryDecodingSuccess(&'a str, &'a str), - BinaryDecodingFailure(&'a str), - ImportSuccess(&'a str, &'a str), - ImportFailure(&'a str), - ImportError(&'a str), - TypeInferenceSuccess(&'a str, &'a str), - TypeInferenceFailure(&'a str), - TypeError(&'a str), - Normalization(&'a str, &'a str), - AlphaNormalization(&'a str, &'a str), +enum Test { + ParserSuccess(TestFile, TestFile), + ParserFailure(TestFile), + Printer(TestFile, TestFile), + BinaryEncoding(TestFile, TestFile), + BinaryDecodingSuccess(TestFile, TestFile), + BinaryDecodingFailure(TestFile), + ImportSuccess(TestFile, TestFile), + ImportFailure(TestFile), + ImportError(TestFile, TestFile), + TypeInferenceSuccess(TestFile, TestFile), + TypeInferenceFailure(TestFile), + TypeError(TestFile, TestFile), + Normalization(TestFile, TestFile), + AlphaNormalization(TestFile, TestFile), } -fn parse_file_str(file_path: &str) -> Result { - Parsed::parse_file(&PathBuf::from(file_path)) +#[allow(dead_code)] +enum TestFile { + Source(&'static str), + Binary(&'static str), + UI(&'static str), +} + +impl TestFile { + pub fn path(&self) -> PathBuf { + match self { + TestFile::Source(path) + | TestFile::Binary(path) + | TestFile::UI(path) => PathBuf::from(path), + } + } + + /// Parse the target file + pub fn parse(&self) -> Result { + match self { + TestFile::Source(_) => Parsed::parse_file(&self.path()), + TestFile::Binary(_) => Parsed::parse_binary_file(&self.path()), + TestFile::UI(_) => panic!("Can't parse a UI test file"), + } + } + /// Parse and resolve the target file + pub fn resolve(&self) -> Result { + Ok(self.parse()?.resolve()?) + } + /// Parse, resolve, tck and normalize the target file + pub fn normalize(&self) -> Result { + Ok(self.resolve()?.typecheck()?.normalize()) + } + + /// Check that the provided expression matches the file contents. + pub fn compare(&self, expr: impl Into) -> Result<()> { + let expr = expr.into(); + let expected = self.parse()?.to_expr(); + assert_eq_display!(expr, expected); + Ok(()) + } + /// Check that the provided expression matches the file contents. + pub fn compare_debug(&self, expr: impl Into) -> Result<()> { + let expr = expr.into(); + let expected = self.parse()?.to_expr(); + assert_eq_pretty!(expr, expected); + Ok(()) + } + /// Check that the provided expression matches the file contents. + pub fn compare_binary( + &self, + expr: impl Into, + ) -> Result<()> { + match self { + TestFile::Binary(_) => {} + _ => panic!("This is not a binary file"), + } + let expr_data = binary::encode(&expr.into())?; + let expected_data = { + let mut data = Vec::new(); + File::open(&self.path())?.read_to_end(&mut data)?; + data + }; + + // Compare bit-by-bit + if expr_data != expected_data { + use serde_cbor::de::from_slice; + use serde_cbor::value::Value; + // use std::io::Write; + // File::create(&expected)?.write_all(&expr_data)?; + // Pretty-print difference + assert_eq_pretty!( + from_slice::(&expr_data).unwrap(), + from_slice::(&expected_data).unwrap() + ); + // If difference was not visible in the cbor::Value, compare normally. + assert_eq!(expr_data, expected_data); + } + Ok(()) + } } #[allow(dead_code)] -pub fn run_test_stringy_error( - test: Test<'_>, -) -> std::result::Result<(), String> { - run_test(test).map_err(|e| e.to_string()).map(|_| ()) +fn run_test_stringy_error(test: Test) -> std::result::Result<(), String> { + run_test(test).map_err(|e| e.to_string())?; + Ok(()) } -pub fn run_test(test: Test<'_>) -> Result<()> { +fn run_test(test: Test) -> Result<()> { use self::Test::*; match test { - ParserSuccess(expr_file_path, expected_file_path) => { - let expr = parse_file_str(&expr_file_path)?; + ParserSuccess(expr, expected) => { + let expr = expr.parse()?; // This exercices both parsing and binary decoding - // Compare parse/decoded - let expected = - Parsed::parse_binary_file(&PathBuf::from(expected_file_path))?; - assert_eq_pretty!(expr, expected); + expected.compare_debug(expr)?; } - ParserFailure(file_path) => { - let err = parse_file_str(&file_path).unwrap_err(); + ParserFailure(expr) => { + let err = expr.parse().unwrap_err(); match &err { Error::Parse(_) => {} Error::IO(e) if e.kind() == std::io::ErrorKind::InvalidData => { @@ -100,79 +173,39 @@ pub fn run_test(test: Test<'_>) -> Result<()> { e => panic!("Expected parse error, got: {:?}", e), } } - BinaryEncoding(expr_file_path, expected_file_path) => { - let expr = parse_file_str(&expr_file_path)?; - let mut expected_data = Vec::new(); - { - File::open(&PathBuf::from(&expected_file_path))? - .read_to_end(&mut expected_data)?; - } - let expr_data = expr.encode()?; - - // Compare bit-by-bit - if expr_data != expected_data { - // use std::io::Write; - // File::create(&expected_file_path)?.write_all(&expr_data)?; - // Pretty-print difference - assert_eq_pretty!( - serde_cbor::de::from_slice::( - &expr_data - ) - .unwrap(), - serde_cbor::de::from_slice::( - &expected_data - ) - .unwrap() - ); - // If difference was not visible in the cbor::Value - assert_eq!(expr_data, expected_data); - } + BinaryEncoding(expr, expected) => { + let expr = expr.parse()?; + expected.compare_binary(expr)?; } - BinaryDecodingSuccess(expr_file_path, expected_file_path) => { - let expr = - Parsed::parse_binary_file(&PathBuf::from(expr_file_path))?; - let expected = parse_file_str(&expected_file_path)?; - assert_eq_pretty!(expr, expected); + BinaryDecodingSuccess(expr, expected) => { + let expr = expr.parse()?; + expected.compare_debug(expr)?; } - BinaryDecodingFailure(file_path) => { - Parsed::parse_binary_file(&PathBuf::from(file_path)).unwrap_err(); + BinaryDecodingFailure(expr) => { + expr.parse().unwrap_err(); } - Printer(expr_file_path, _) => { - let expected = parse_file_str(&expr_file_path)?; + Printer(expr, _) => { + let expected = expr.parse()?; // Round-trip pretty-printer let expr: Parsed = Parsed::parse_str(&expected.to_string())?; assert_eq!(expr, expected); } - ImportSuccess(expr_file_path, expected_file_path) => { - let expr = parse_file_str(&expr_file_path)? - .resolve()? - .typecheck()? - .normalize(); - let expected = parse_file_str(&expected_file_path)? - .resolve()? - .typecheck()? - .normalize(); - - assert_eq_display!(expr, expected); + ImportSuccess(expr, expected) => { + let expr = expr.normalize()?; + expected.compare(expr)?; } - ImportFailure(file_path) => { - parse_file_str(&file_path)?.resolve().unwrap_err(); + ImportFailure(expr) => { + expr.parse()?.resolve().unwrap_err(); } // Checks the output of the type error against a text file. If the text file doesn't exist, // we instead write to it the output we got. This makes it easy to update those files: just // `rm -r dhall/tests/type-errors` and run the tests again. - ImportError(file_path) => { - let err: Error = - parse_file_str(&file_path)?.resolve().unwrap_err().into(); - let file_path = PathBuf::from(file_path); - let error_file_path = file_path - .strip_prefix("../dhall-lang/tests/import/failure/") - .or_else(|_| file_path.strip_prefix("tests/import/failure/")) - .unwrap(); + ImportError(expr, expected) => { + let base_path = expected.path(); let error_file_path = - PathBuf::from("tests/errors/import/").join(error_file_path); - let error_file_path = error_file_path.with_extension("txt"); + PathBuf::from("tests/errors/import/").join(base_path); + let err: Error = expr.parse()?.resolve().unwrap_err().into(); if error_file_path.is_file() { let expected_msg = std::fs::read_to_string(error_file_path)?; let msg = format!("{}\n", err); @@ -183,42 +216,22 @@ pub fn run_test(test: Test<'_>) -> Result<()> { writeln!(file, "{}", err)?; } } - TypeInferenceSuccess(expr_file_path, expected_file_path) => { - let expr = - parse_file_str(&expr_file_path)?.resolve()?.typecheck()?; - let ty = expr.get_type()?.to_expr(); - let expected = parse_file_str(&expected_file_path)?.to_expr(); - assert_eq_display!(ty, expected); + TypeInferenceSuccess(expr, expected) => { + let ty = expr.resolve()?.typecheck()?.get_type()?; + expected.compare(ty)?; } - TypeInferenceFailure(file_path) => { - let res = parse_file_str(&file_path)?.skip_resolve()?.typecheck(); - if let Ok(e) = &res { - // If e did typecheck, check that get_type fails - e.get_type().unwrap_err(); - } + TypeInferenceFailure(expr) => { + expr.resolve()?.typecheck().unwrap_err(); } // Checks the output of the type error against a text file. If the text file doesn't exist, // we instead write to it the output we got. This makes it easy to update those files: just // `rm -r dhall/tests/type-errors` and run the tests again. - TypeError(file_path) => { - let res = parse_file_str(&file_path)?.skip_resolve()?.typecheck(); - let file_path = PathBuf::from(file_path); - let error_file_path = file_path - .strip_prefix("../dhall-lang/tests/type-inference/failure/") - .or_else(|_| { - file_path.strip_prefix("tests/type-inference/failure/") - }) - .unwrap(); + TypeError(expr, expected) => { + let base_path = expected.path(); let error_file_path = - PathBuf::from("tests/type-errors/").join(error_file_path); - let error_file_path = error_file_path.with_extension("txt"); - let err: Error = match res { - Ok(e) => { - // If e did typecheck, check that get_type fails - e.get_type().unwrap_err().into() - } - Err(e) => e.into(), - }; + PathBuf::from("tests/type-errors/").join(base_path); + + let err: Error = expr.resolve()?.typecheck().unwrap_err().into(); if error_file_path.is_file() { let expected_msg = std::fs::read_to_string(error_file_path)?; @@ -230,25 +243,13 @@ pub fn run_test(test: Test<'_>) -> Result<()> { writeln!(file, "{}", err)?; } } - Normalization(expr_file_path, expected_file_path) => { - let expr = parse_file_str(&expr_file_path)? - .resolve()? - .typecheck()? - .normalize() - .to_expr(); - let expected = parse_file_str(&expected_file_path)?.to_expr(); - - assert_eq_display!(expr, expected); + Normalization(expr, expected) => { + let expr = expr.normalize()?; + expected.compare(expr)?; } - AlphaNormalization(expr_file_path, expected_file_path) => { - let expr = parse_file_str(&expr_file_path)? - .resolve()? - .typecheck()? - .normalize() - .to_expr_alpha(); - let expected = parse_file_str(&expected_file_path)?.to_expr(); - - assert_eq_display!(expr, expected); + AlphaNormalization(expr, expected) => { + let expr = expr.normalize()?.to_expr_alpha(); + expected.compare(expr)?; } } Ok(()) -- cgit v1.2.3 From 8abb6c24cd26b64d708a74faaa28cc9294dc3466 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 17:47:58 +0000 Subject: Move ui outputs to a sensible place --- dhall/build.rs | 16 ++++++++-------- dhall/src/tests.rs | 11 +++-------- dhall/tests/errors/import/cycle.txt | 1 - dhall/tests/errors/import/importBoundary.txt | 1 - dhall/tests/import/failure/cycle.txt | 1 + dhall/tests/import/failure/importBoundary.txt | 1 + dhall/tests/type-errors/SortInLet.txt | 1 - dhall/tests/type-errors/hurkensParadox.txt | 15 --------------- dhall/tests/type-errors/mixedUnions.txt | 6 ------ dhall/tests/type-errors/recordOfKind.txt | 1 - .../type-errors/unit/AnnotationRecordWrongFieldName.txt | 6 ------ .../type-errors/unit/AnnotationRecordWrongFieldType.txt | 6 ------ dhall/tests/type-errors/unit/AssertAlphaTrap.txt | 6 ------ dhall/tests/type-errors/unit/AssertDoubleZeros.txt | 6 ------ dhall/tests/type-errors/unit/AssertNotEquivalence.txt | 6 ------ dhall/tests/type-errors/unit/AssertTriviallyFalse.txt | 6 ------ .../type-errors/unit/CompletionMissingRequiredField.txt | 7 ------- .../type-errors/unit/CompletionWithWrongDefaultType.txt | 7 ------- .../type-errors/unit/CompletionWithWrongFieldName.txt | 7 ------- .../unit/CompletionWithWrongOverridenType.txt | 7 ------- dhall/tests/type-errors/unit/EmptyToMap.txt | 6 ------ dhall/tests/type-errors/unit/EquivalenceNotSameType.txt | 6 ------ dhall/tests/type-errors/unit/EquivalenceNotTerms.txt | 6 ------ .../unit/FunctionApplicationArgumentNotMatch.txt | 9 --------- .../unit/FunctionApplicationIsNotFunction.txt | 6 ------ .../type-errors/unit/FunctionArgumentTypeNotAType.txt | 7 ------- .../unit/FunctionTypeArgumentTypeNotAType.txt | 7 ------- dhall/tests/type-errors/unit/FunctionTypeKindSort.txt | 1 - dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt | 1 - dhall/tests/type-errors/unit/HeterogenousToMap.txt | 6 ------ dhall/tests/type-errors/unit/IfBranchesNotMatch.txt | 6 ------ dhall/tests/type-errors/unit/IfBranchesNotType.txt | 6 ------ dhall/tests/type-errors/unit/IfNotBool.txt | 6 ------ dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt | 6 ------ dhall/tests/type-errors/unit/ListLiteralEmptyNotType.txt | 9 --------- dhall/tests/type-errors/unit/ListLiteralNotType.txt | 6 ------ .../tests/type-errors/unit/ListLiteralTypesNotMatch.txt | 6 ------ .../type-errors/unit/MergeAlternativeHasNoHandler.txt | 6 ------ dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt | 6 ------ dhall/tests/type-errors/unit/MergeAnnotationNotType.txt | 6 ------ .../unit/MergeEmptyNeedsDirectAnnotation1.txt | 6 ------ .../unit/MergeEmptyNeedsDirectAnnotation2.txt | 6 ------ .../type-errors/unit/MergeEmptyWithoutAnnotation.txt | 6 ------ dhall/tests/type-errors/unit/MergeHandlerNotFunction.txt | 9 --------- dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt | 6 ------ .../unit/MergeHandlerNotMatchAlternativeType.txt | 8 -------- .../type-errors/unit/MergeHandlersWithDifferentType.txt | 6 ------ dhall/tests/type-errors/unit/MergeLhsNotRecord.txt | 6 ------ dhall/tests/type-errors/unit/MergeMissingHandler1.txt | 6 ------ dhall/tests/type-errors/unit/MergeMissingHandler2.txt | 6 ------ dhall/tests/type-errors/unit/MergeRhsNotUnion.txt | 6 ------ dhall/tests/type-errors/unit/MergeUnusedHandler.txt | 6 ------ dhall/tests/type-errors/unit/MistypedToMap1.txt | 6 ------ dhall/tests/type-errors/unit/MistypedToMap2.txt | 6 ------ dhall/tests/type-errors/unit/MistypedToMap3.txt | 6 ------ dhall/tests/type-errors/unit/MistypedToMap4.txt | 6 ------ .../tests/type-errors/unit/NaturalSubtractNotNatural.txt | 9 --------- dhall/tests/type-errors/unit/NonRecordToMap.txt | 6 ------ dhall/tests/type-errors/unit/OperatorAndNotBool.txt | 6 ------ dhall/tests/type-errors/unit/OperatorEqualNotBool.txt | 6 ------ .../unit/OperatorListConcatenateLhsNotList.txt | 6 ------ .../unit/OperatorListConcatenateListsNotMatch.txt | 6 ------ .../unit/OperatorListConcatenateNotListsButMatch.txt | 6 ------ .../unit/OperatorListConcatenateRhsNotList.txt | 6 ------ dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt | 6 ------ dhall/tests/type-errors/unit/OperatorOrNotBool.txt | 6 ------ dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt | 6 ------ .../unit/OperatorTextConcatenateLhsNotText.txt | 6 ------ .../unit/OperatorTextConcatenateRhsNotText.txt | 6 ------ dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt | 6 ------ .../type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt | 6 ------ .../type-errors/unit/OptionalDeprecatedSyntaxPresent.txt | 6 ------ .../tests/type-errors/unit/RecordLitDuplicateFields.txt | 6 ------ dhall/tests/type-errors/unit/RecordMixedKinds3.txt | 1 - .../unit/RecordProjectionByTypeFieldTypeMismatch.txt | 6 ------ .../unit/RecordProjectionByTypeNotPresent.txt | 6 ------ .../type-errors/unit/RecordProjectionDuplicateFields.txt | 6 ------ dhall/tests/type-errors/unit/RecordProjectionEmpty.txt | 6 ------ .../type-errors/unit/RecordProjectionNotPresent.txt | 6 ------ .../tests/type-errors/unit/RecordProjectionNotRecord.txt | 6 ------ dhall/tests/type-errors/unit/RecordSelectionEmpty.txt | 6 ------ .../tests/type-errors/unit/RecordSelectionNotPresent.txt | 6 ------ .../tests/type-errors/unit/RecordSelectionNotRecord.txt | 6 ------ .../type-errors/unit/RecordSelectionTypeNotUnionType.txt | 6 ------ .../tests/type-errors/unit/RecordTypeDuplicateFields.txt | 6 ------ dhall/tests/type-errors/unit/RecordTypeValueMember.txt | 6 ------ .../unit/RecursiveRecordMergeLhsNotRecord.txt | 1 - .../type-errors/unit/RecursiveRecordMergeOverlapping.txt | 1 - .../unit/RecursiveRecordMergeRhsNotRecord.txt | 1 - .../unit/RecursiveRecordTypeMergeLhsNotRecordType.txt | 6 ------ .../unit/RecursiveRecordTypeMergeOverlapping.txt | 1 - .../unit/RecursiveRecordTypeMergeRhsNotRecordType.txt | 6 ------ .../unit/RightBiasedRecordMergeLhsNotRecord.txt | 6 ------ .../unit/RightBiasedRecordMergeMixedKinds2.txt | 1 - .../unit/RightBiasedRecordMergeMixedKinds3.txt | 1 - .../unit/RightBiasedRecordMergeRhsNotRecord.txt | 6 ------ dhall/tests/type-errors/unit/SomeNotType.txt | 6 ------ dhall/tests/type-errors/unit/Sort.txt | 1 - .../type-errors/unit/TextLiteralInterpolateNotText.txt | 6 ------ .../type-errors/unit/ToMapEmptyInvalidAnnotation.txt | 7 ------- dhall/tests/type-errors/unit/ToMapWrongKind.txt | 6 ------ dhall/tests/type-errors/unit/TypeAnnotationWrong.txt | 6 ------ .../type-errors/unit/UnionConstructorFieldNotPresent.txt | 6 ------ .../unit/UnionDeprecatedConstructorsKeyword.txt | 6 ------ .../type-errors/unit/UnionTypeDuplicateVariants1.txt | 6 ------ .../type-errors/unit/UnionTypeDuplicateVariants2.txt | 6 ------ dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt | 6 ------ dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt | 6 ------ dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt | 6 ------ dhall/tests/type-errors/unit/UnionTypeNotType.txt | 6 ------ dhall/tests/type-errors/unit/VariableFree.txt | 6 ------ dhall/tests/type-inference/failure/SortInLet.txt | 1 + dhall/tests/type-inference/failure/hurkensParadox.txt | 15 +++++++++++++++ dhall/tests/type-inference/failure/mixedUnions.txt | 6 ++++++ dhall/tests/type-inference/failure/recordOfKind.txt | 1 + .../failure/unit/AnnotationRecordWrongFieldName.txt | 6 ++++++ .../failure/unit/AnnotationRecordWrongFieldType.txt | 6 ++++++ .../type-inference/failure/unit/AssertAlphaTrap.txt | 6 ++++++ .../type-inference/failure/unit/AssertDoubleZeros.txt | 6 ++++++ .../type-inference/failure/unit/AssertNotEquivalence.txt | 6 ++++++ .../type-inference/failure/unit/AssertTriviallyFalse.txt | 6 ++++++ .../failure/unit/CompletionMissingRequiredField.txt | 7 +++++++ .../failure/unit/CompletionWithWrongDefaultType.txt | 7 +++++++ .../failure/unit/CompletionWithWrongFieldName.txt | 7 +++++++ .../failure/unit/CompletionWithWrongOverridenType.txt | 7 +++++++ dhall/tests/type-inference/failure/unit/EmptyToMap.txt | 6 ++++++ .../failure/unit/EquivalenceNotSameType.txt | 6 ++++++ .../type-inference/failure/unit/EquivalenceNotTerms.txt | 6 ++++++ .../failure/unit/FunctionApplicationArgumentNotMatch.txt | 9 +++++++++ .../failure/unit/FunctionApplicationIsNotFunction.txt | 6 ++++++ .../failure/unit/FunctionArgumentTypeNotAType.txt | 7 +++++++ .../failure/unit/FunctionTypeArgumentTypeNotAType.txt | 7 +++++++ .../type-inference/failure/unit/FunctionTypeKindSort.txt | 1 + .../type-inference/failure/unit/FunctionTypeTypeSort.txt | 1 + .../type-inference/failure/unit/HeterogenousToMap.txt | 6 ++++++ .../type-inference/failure/unit/IfBranchesNotMatch.txt | 6 ++++++ .../type-inference/failure/unit/IfBranchesNotType.txt | 6 ++++++ dhall/tests/type-inference/failure/unit/IfNotBool.txt | 6 ++++++ .../failure/unit/LetWithWrongAnnotation.txt | 6 ++++++ .../failure/unit/ListLiteralEmptyNotType.txt | 9 +++++++++ .../type-inference/failure/unit/ListLiteralNotType.txt | 6 ++++++ .../failure/unit/ListLiteralTypesNotMatch.txt | 6 ++++++ .../failure/unit/MergeAlternativeHasNoHandler.txt | 6 ++++++ .../failure/unit/MergeAnnotationMismatch.txt | 6 ++++++ .../failure/unit/MergeAnnotationNotType.txt | 6 ++++++ .../failure/unit/MergeEmptyNeedsDirectAnnotation1.txt | 6 ++++++ .../failure/unit/MergeEmptyNeedsDirectAnnotation2.txt | 6 ++++++ .../failure/unit/MergeEmptyWithoutAnnotation.txt | 6 ++++++ .../failure/unit/MergeHandlerNotFunction.txt | 9 +++++++++ .../failure/unit/MergeHandlerNotInUnion.txt | 6 ++++++ .../failure/unit/MergeHandlerNotMatchAlternativeType.txt | 8 ++++++++ .../failure/unit/MergeHandlersWithDifferentType.txt | 6 ++++++ .../type-inference/failure/unit/MergeLhsNotRecord.txt | 6 ++++++ .../type-inference/failure/unit/MergeMissingHandler1.txt | 6 ++++++ .../type-inference/failure/unit/MergeMissingHandler2.txt | 6 ++++++ .../type-inference/failure/unit/MergeRhsNotUnion.txt | 6 ++++++ .../type-inference/failure/unit/MergeUnusedHandler.txt | 6 ++++++ .../tests/type-inference/failure/unit/MistypedToMap1.txt | 6 ++++++ .../tests/type-inference/failure/unit/MistypedToMap2.txt | 6 ++++++ .../tests/type-inference/failure/unit/MistypedToMap3.txt | 6 ++++++ .../tests/type-inference/failure/unit/MistypedToMap4.txt | 6 ++++++ .../failure/unit/NaturalSubtractNotNatural.txt | 9 +++++++++ .../tests/type-inference/failure/unit/NonRecordToMap.txt | 6 ++++++ .../type-inference/failure/unit/OperatorAndNotBool.txt | 6 ++++++ .../type-inference/failure/unit/OperatorEqualNotBool.txt | 6 ++++++ .../failure/unit/OperatorListConcatenateLhsNotList.txt | 6 ++++++ .../unit/OperatorListConcatenateListsNotMatch.txt | 6 ++++++ .../unit/OperatorListConcatenateNotListsButMatch.txt | 6 ++++++ .../failure/unit/OperatorListConcatenateRhsNotList.txt | 6 ++++++ .../failure/unit/OperatorNotEqualNotBool.txt | 6 ++++++ .../type-inference/failure/unit/OperatorOrNotBool.txt | 6 ++++++ .../failure/unit/OperatorPlusNotNatural.txt | 6 ++++++ .../failure/unit/OperatorTextConcatenateLhsNotText.txt | 6 ++++++ .../failure/unit/OperatorTextConcatenateRhsNotText.txt | 6 ++++++ .../failure/unit/OperatorTimesNotNatural.txt | 6 ++++++ .../failure/unit/OptionalDeprecatedSyntaxAbsent.txt | 6 ++++++ .../failure/unit/OptionalDeprecatedSyntaxPresent.txt | 6 ++++++ .../failure/unit/RecordLitDuplicateFields.txt | 6 ++++++ .../type-inference/failure/unit/RecordMixedKinds3.txt | 1 + .../unit/RecordProjectionByTypeFieldTypeMismatch.txt | 6 ++++++ .../failure/unit/RecordProjectionByTypeNotPresent.txt | 6 ++++++ .../failure/unit/RecordProjectionDuplicateFields.txt | 6 ++++++ .../failure/unit/RecordProjectionEmpty.txt | 6 ++++++ .../failure/unit/RecordProjectionNotPresent.txt | 6 ++++++ .../failure/unit/RecordProjectionNotRecord.txt | 6 ++++++ .../type-inference/failure/unit/RecordSelectionEmpty.txt | 6 ++++++ .../failure/unit/RecordSelectionNotPresent.txt | 6 ++++++ .../failure/unit/RecordSelectionNotRecord.txt | 6 ++++++ .../failure/unit/RecordSelectionTypeNotUnionType.txt | 6 ++++++ .../failure/unit/RecordTypeDuplicateFields.txt | 6 ++++++ .../failure/unit/RecordTypeValueMember.txt | 6 ++++++ .../failure/unit/RecursiveRecordMergeLhsNotRecord.txt | 1 + .../failure/unit/RecursiveRecordMergeOverlapping.txt | 1 + .../failure/unit/RecursiveRecordMergeRhsNotRecord.txt | 1 + .../unit/RecursiveRecordTypeMergeLhsNotRecordType.txt | 6 ++++++ .../failure/unit/RecursiveRecordTypeMergeOverlapping.txt | 1 + .../unit/RecursiveRecordTypeMergeRhsNotRecordType.txt | 6 ++++++ .../failure/unit/RightBiasedRecordMergeLhsNotRecord.txt | 6 ++++++ .../failure/unit/RightBiasedRecordMergeMixedKinds2.txt | 1 + .../failure/unit/RightBiasedRecordMergeMixedKinds3.txt | 1 + .../failure/unit/RightBiasedRecordMergeRhsNotRecord.txt | 6 ++++++ dhall/tests/type-inference/failure/unit/SomeNotType.txt | 6 ++++++ dhall/tests/type-inference/failure/unit/Sort.txt | 1 + .../failure/unit/TextLiteralInterpolateNotText.txt | 6 ++++++ .../failure/unit/ToMapEmptyInvalidAnnotation.txt | 7 +++++++ .../tests/type-inference/failure/unit/ToMapWrongKind.txt | 6 ++++++ .../type-inference/failure/unit/TypeAnnotationWrong.txt | 6 ++++++ .../failure/unit/UnionConstructorFieldNotPresent.txt | 6 ++++++ .../failure/unit/UnionDeprecatedConstructorsKeyword.txt | 6 ++++++ .../failure/unit/UnionTypeDuplicateVariants1.txt | 6 ++++++ .../failure/unit/UnionTypeDuplicateVariants2.txt | 6 ++++++ .../type-inference/failure/unit/UnionTypeMixedKinds.txt | 6 ++++++ .../type-inference/failure/unit/UnionTypeMixedKinds2.txt | 6 ++++++ .../type-inference/failure/unit/UnionTypeMixedKinds3.txt | 6 ++++++ .../type-inference/failure/unit/UnionTypeNotType.txt | 6 ++++++ dhall/tests/type-inference/failure/unit/VariableFree.txt | 6 ++++++ 216 files changed, 613 insertions(+), 618 deletions(-) delete mode 100644 dhall/tests/errors/import/cycle.txt delete mode 100644 dhall/tests/errors/import/importBoundary.txt create mode 100644 dhall/tests/import/failure/cycle.txt create mode 100644 dhall/tests/import/failure/importBoundary.txt delete mode 100644 dhall/tests/type-errors/SortInLet.txt delete mode 100644 dhall/tests/type-errors/hurkensParadox.txt delete mode 100644 dhall/tests/type-errors/mixedUnions.txt delete mode 100644 dhall/tests/type-errors/recordOfKind.txt delete mode 100644 dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt delete mode 100644 dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt delete mode 100644 dhall/tests/type-errors/unit/AssertAlphaTrap.txt delete mode 100644 dhall/tests/type-errors/unit/AssertDoubleZeros.txt delete mode 100644 dhall/tests/type-errors/unit/AssertNotEquivalence.txt delete mode 100644 dhall/tests/type-errors/unit/AssertTriviallyFalse.txt delete mode 100644 dhall/tests/type-errors/unit/CompletionMissingRequiredField.txt delete mode 100644 dhall/tests/type-errors/unit/CompletionWithWrongDefaultType.txt delete mode 100644 dhall/tests/type-errors/unit/CompletionWithWrongFieldName.txt delete mode 100644 dhall/tests/type-errors/unit/CompletionWithWrongOverridenType.txt delete mode 100644 dhall/tests/type-errors/unit/EmptyToMap.txt delete mode 100644 dhall/tests/type-errors/unit/EquivalenceNotSameType.txt delete mode 100644 dhall/tests/type-errors/unit/EquivalenceNotTerms.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionApplicationArgumentNotMatch.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionApplicationIsNotFunction.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionArgumentTypeNotAType.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionTypeArgumentTypeNotAType.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionTypeKindSort.txt delete mode 100644 dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt delete mode 100644 dhall/tests/type-errors/unit/HeterogenousToMap.txt delete mode 100644 dhall/tests/type-errors/unit/IfBranchesNotMatch.txt delete mode 100644 dhall/tests/type-errors/unit/IfBranchesNotType.txt delete mode 100644 dhall/tests/type-errors/unit/IfNotBool.txt delete mode 100644 dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt delete mode 100644 dhall/tests/type-errors/unit/ListLiteralEmptyNotType.txt delete mode 100644 dhall/tests/type-errors/unit/ListLiteralNotType.txt delete mode 100644 dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt delete mode 100644 dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt delete mode 100644 dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt delete mode 100644 dhall/tests/type-errors/unit/MergeAnnotationNotType.txt delete mode 100644 dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt delete mode 100644 dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt delete mode 100644 dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt delete mode 100644 dhall/tests/type-errors/unit/MergeHandlerNotFunction.txt delete mode 100644 dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt delete mode 100644 dhall/tests/type-errors/unit/MergeHandlerNotMatchAlternativeType.txt delete mode 100644 dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt delete mode 100644 dhall/tests/type-errors/unit/MergeLhsNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/MergeMissingHandler1.txt delete mode 100644 dhall/tests/type-errors/unit/MergeMissingHandler2.txt delete mode 100644 dhall/tests/type-errors/unit/MergeRhsNotUnion.txt delete mode 100644 dhall/tests/type-errors/unit/MergeUnusedHandler.txt delete mode 100644 dhall/tests/type-errors/unit/MistypedToMap1.txt delete mode 100644 dhall/tests/type-errors/unit/MistypedToMap2.txt delete mode 100644 dhall/tests/type-errors/unit/MistypedToMap3.txt delete mode 100644 dhall/tests/type-errors/unit/MistypedToMap4.txt delete mode 100644 dhall/tests/type-errors/unit/NaturalSubtractNotNatural.txt delete mode 100644 dhall/tests/type-errors/unit/NonRecordToMap.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorAndNotBool.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorEqualNotBool.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorOrNotBool.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt delete mode 100644 dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt delete mode 100644 dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt delete mode 100644 dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt delete mode 100644 dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt delete mode 100644 dhall/tests/type-errors/unit/RecordMixedKinds3.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionByTypeFieldTypeMismatch.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionByTypeNotPresent.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionEmpty.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt delete mode 100644 dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/RecordSelectionEmpty.txt delete mode 100644 dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt delete mode 100644 dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt delete mode 100644 dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt delete mode 100644 dhall/tests/type-errors/unit/RecordTypeValueMember.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt delete mode 100644 dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt delete mode 100644 dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt delete mode 100644 dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt delete mode 100644 dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt delete mode 100644 dhall/tests/type-errors/unit/SomeNotType.txt delete mode 100644 dhall/tests/type-errors/unit/Sort.txt delete mode 100644 dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt delete mode 100644 dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt delete mode 100644 dhall/tests/type-errors/unit/ToMapWrongKind.txt delete mode 100644 dhall/tests/type-errors/unit/TypeAnnotationWrong.txt delete mode 100644 dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt delete mode 100644 dhall/tests/type-errors/unit/UnionDeprecatedConstructorsKeyword.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt delete mode 100644 dhall/tests/type-errors/unit/UnionTypeNotType.txt delete mode 100644 dhall/tests/type-errors/unit/VariableFree.txt create mode 100644 dhall/tests/type-inference/failure/SortInLet.txt create mode 100644 dhall/tests/type-inference/failure/hurkensParadox.txt create mode 100644 dhall/tests/type-inference/failure/mixedUnions.txt create mode 100644 dhall/tests/type-inference/failure/recordOfKind.txt create mode 100644 dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldName.txt create mode 100644 dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldType.txt create mode 100644 dhall/tests/type-inference/failure/unit/AssertAlphaTrap.txt create mode 100644 dhall/tests/type-inference/failure/unit/AssertDoubleZeros.txt create mode 100644 dhall/tests/type-inference/failure/unit/AssertNotEquivalence.txt create mode 100644 dhall/tests/type-inference/failure/unit/AssertTriviallyFalse.txt create mode 100644 dhall/tests/type-inference/failure/unit/CompletionMissingRequiredField.txt create mode 100644 dhall/tests/type-inference/failure/unit/CompletionWithWrongDefaultType.txt create mode 100644 dhall/tests/type-inference/failure/unit/CompletionWithWrongFieldName.txt create mode 100644 dhall/tests/type-inference/failure/unit/CompletionWithWrongOverridenType.txt create mode 100644 dhall/tests/type-inference/failure/unit/EmptyToMap.txt create mode 100644 dhall/tests/type-inference/failure/unit/EquivalenceNotSameType.txt create mode 100644 dhall/tests/type-inference/failure/unit/EquivalenceNotTerms.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionApplicationArgumentNotMatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionApplicationIsNotFunction.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionArgumentTypeNotAType.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionTypeArgumentTypeNotAType.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionTypeKindSort.txt create mode 100644 dhall/tests/type-inference/failure/unit/FunctionTypeTypeSort.txt create mode 100644 dhall/tests/type-inference/failure/unit/HeterogenousToMap.txt create mode 100644 dhall/tests/type-inference/failure/unit/IfBranchesNotMatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/IfBranchesNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/IfNotBool.txt create mode 100644 dhall/tests/type-inference/failure/unit/LetWithWrongAnnotation.txt create mode 100644 dhall/tests/type-inference/failure/unit/ListLiteralEmptyNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/ListLiteralNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/ListLiteralTypesNotMatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeAlternativeHasNoHandler.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeAnnotationMismatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeAnnotationNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation1.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation2.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeEmptyWithoutAnnotation.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeHandlerNotFunction.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeHandlerNotInUnion.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeHandlerNotMatchAlternativeType.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeHandlersWithDifferentType.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeLhsNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeMissingHandler1.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeMissingHandler2.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeRhsNotUnion.txt create mode 100644 dhall/tests/type-inference/failure/unit/MergeUnusedHandler.txt create mode 100644 dhall/tests/type-inference/failure/unit/MistypedToMap1.txt create mode 100644 dhall/tests/type-inference/failure/unit/MistypedToMap2.txt create mode 100644 dhall/tests/type-inference/failure/unit/MistypedToMap3.txt create mode 100644 dhall/tests/type-inference/failure/unit/MistypedToMap4.txt create mode 100644 dhall/tests/type-inference/failure/unit/NaturalSubtractNotNatural.txt create mode 100644 dhall/tests/type-inference/failure/unit/NonRecordToMap.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorAndNotBool.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorEqualNotBool.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorListConcatenateLhsNotList.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorListConcatenateListsNotMatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorListConcatenateNotListsButMatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorListConcatenateRhsNotList.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorNotEqualNotBool.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorOrNotBool.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorPlusNotNatural.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorTextConcatenateLhsNotText.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorTextConcatenateRhsNotText.txt create mode 100644 dhall/tests/type-inference/failure/unit/OperatorTimesNotNatural.txt create mode 100644 dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxAbsent.txt create mode 100644 dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxPresent.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordLitDuplicateFields.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionByTypeFieldTypeMismatch.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionByTypeNotPresent.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionDuplicateFields.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionEmpty.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionNotPresent.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordProjectionNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordSelectionEmpty.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordSelectionNotPresent.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordSelectionNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordSelectionTypeNotUnionType.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordTypeDuplicateFields.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecordTypeValueMember.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordMergeLhsNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordMergeOverlapping.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordMergeRhsNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeOverlapping.txt create mode 100644 dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt create mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeLhsNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt create mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt create mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeRhsNotRecord.txt create mode 100644 dhall/tests/type-inference/failure/unit/SomeNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/Sort.txt create mode 100644 dhall/tests/type-inference/failure/unit/TextLiteralInterpolateNotText.txt create mode 100644 dhall/tests/type-inference/failure/unit/ToMapEmptyInvalidAnnotation.txt create mode 100644 dhall/tests/type-inference/failure/unit/ToMapWrongKind.txt create mode 100644 dhall/tests/type-inference/failure/unit/TypeAnnotationWrong.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionConstructorFieldNotPresent.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionDeprecatedConstructorsKeyword.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants1.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants2.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt create mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeNotType.txt create mode 100644 dhall/tests/type-inference/failure/unit/VariableFree.txt diff --git a/dhall/build.rs b/dhall/build.rs index 3955b3a..67f11e2 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -110,14 +110,14 @@ fn make_test_module( } Some(output_type @ FileType::UI) => { let input = feature.input_type.construct(&path); - let output_file = PathBuf::from(path.as_ref()) - .strip_prefix(base_path) - .unwrap() - .strip_prefix(feature.directory) - .unwrap() - .to_string_lossy() - .into_owned(); - let output = output_type.construct(&output_file); + // All ui outputs are in the local `tests/` directory. + let output_file = PathBuf::from("tests/").join( + PathBuf::from(path.as_ref()) + .strip_prefix(base_path) + .unwrap(), + ); + let output = + output_type.construct(&output_file.to_str().unwrap()); format!("{}({}, {})", feature.variant, input, output) } Some(output_type) => { diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 659317f..d8ce2fa 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -201,11 +201,9 @@ fn run_test(test: Test) -> Result<()> { // we instead write to it the output we got. This makes it easy to update those files: just // `rm -r dhall/tests/type-errors` and run the tests again. ImportError(expr, expected) => { - let base_path = expected.path(); - let error_file_path = - PathBuf::from("tests/errors/import/").join(base_path); - let err: Error = expr.parse()?.resolve().unwrap_err().into(); + + let error_file_path = expected.path(); if error_file_path.is_file() { let expected_msg = std::fs::read_to_string(error_file_path)?; let msg = format!("{}\n", err); @@ -227,12 +225,9 @@ fn run_test(test: Test) -> Result<()> { // we instead write to it the output we got. This makes it easy to update those files: just // `rm -r dhall/tests/type-errors` and run the tests again. TypeError(expr, expected) => { - let base_path = expected.path(); - let error_file_path = - PathBuf::from("tests/type-errors/").join(base_path); - let err: Error = expr.resolve()?.typecheck().unwrap_err().into(); + let error_file_path = expected.path(); if error_file_path.is_file() { let expected_msg = std::fs::read_to_string(error_file_path)?; let msg = format!("{}\n", err); diff --git a/dhall/tests/errors/import/cycle.txt b/dhall/tests/errors/import/cycle.txt deleted file mode 100644 index 0a20503..0000000 --- a/dhall/tests/errors/import/cycle.txt +++ /dev/null @@ -1 +0,0 @@ -Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Resolve(Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }, Resolve(ImportCycle([Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }], Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }))))) diff --git a/dhall/tests/errors/import/importBoundary.txt b/dhall/tests/errors/import/importBoundary.txt deleted file mode 100644 index 8f78e48..0000000 --- a/dhall/tests/errors/import/importBoundary.txt +++ /dev/null @@ -1 +0,0 @@ -Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "importBoundary.dhall"] }), hash: None }, Typecheck(TypeError { message: Custom("error: unbound variable `x`\n --> :1:0\n |\n...\n3 | x\n | ^ not found in this scope\n |") })) diff --git a/dhall/tests/import/failure/cycle.txt b/dhall/tests/import/failure/cycle.txt new file mode 100644 index 0000000..0a20503 --- /dev/null +++ b/dhall/tests/import/failure/cycle.txt @@ -0,0 +1 @@ +Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Resolve(Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }, Resolve(ImportCycle([Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }, Import { mode: Code, location: Local(Parent, FilePath { file_path: ["failure", "cycle.dhall"] }), hash: None }], Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "cycle.dhall"] }), hash: None }))))) diff --git a/dhall/tests/import/failure/importBoundary.txt b/dhall/tests/import/failure/importBoundary.txt new file mode 100644 index 0000000..8f78e48 --- /dev/null +++ b/dhall/tests/import/failure/importBoundary.txt @@ -0,0 +1 @@ +Recursive(Import { mode: Code, location: Local(Parent, FilePath { file_path: ["data", "importBoundary.dhall"] }), hash: None }, Typecheck(TypeError { message: Custom("error: unbound variable `x`\n --> :1:0\n |\n...\n3 | x\n | ^ not found in this scope\n |") })) diff --git a/dhall/tests/type-errors/SortInLet.txt b/dhall/tests/type-errors/SortInLet.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/SortInLet.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/hurkensParadox.txt b/dhall/tests/type-errors/hurkensParadox.txt deleted file mode 100644 index 6b99615..0000000 --- a/dhall/tests/type-errors/hurkensParadox.txt +++ /dev/null @@ -1,15 +0,0 @@ -Type error: error: wrong type of function argument - --> :6:23 - | - 1 | let bottom : Type = ∀(any : Type) → any - 2 | - 3 | in let not : Type → Type = λ(p : Type) → p → bottom - 4 | -... -10 | : pow (pow U) → U -11 | = λ(t : pow (pow U)) - | ^^^ this expects an argument of type: Kind - | ^ but this has type: Sort - | - = note: expected type `Kind` - found type `Sort` diff --git a/dhall/tests/type-errors/mixedUnions.txt b/dhall/tests/type-errors/mixedUnions.txt deleted file mode 100644 index 8e0026d..0000000 --- a/dhall/tests/type-errors/mixedUnions.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | < Left : Natural | Right : Type > - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/recordOfKind.txt b/dhall/tests/type-errors/recordOfKind.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/recordOfKind.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt deleted file mode 100644 index 2a754fc..0000000 --- a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: annot mismatch: ({ x = 1 } : { x : Natural }) : { y : Natural } - --> :1:0 - | -1 | { x = 1 } : { y : Natural } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ({ x = 1 } : { x : Natural }) : { y : Natural } - | diff --git a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt deleted file mode 100644 index e67edb8..0000000 --- a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: annot mismatch: ({ x = 1 } : { x : Natural }) : { x : Text } - --> :1:0 - | -1 | { x = 1 } : { x : Text } - | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ({ x = 1 } : { x : Natural }) : { x : Text } - | diff --git a/dhall/tests/type-errors/unit/AssertAlphaTrap.txt b/dhall/tests/type-errors/unit/AssertAlphaTrap.txt deleted file mode 100644 index 7e27d00..0000000 --- a/dhall/tests/type-errors/unit/AssertAlphaTrap.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: unbound variable ``_`` - --> :1:46 - | -1 | assert : (\(_: Bool) -> _) === (\(x: Bool) -> _) - | ^ not found in this scope - | diff --git a/dhall/tests/type-errors/unit/AssertDoubleZeros.txt b/dhall/tests/type-errors/unit/AssertDoubleZeros.txt deleted file mode 100644 index 12231a0..0000000 --- a/dhall/tests/type-errors/unit/AssertDoubleZeros.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: AssertMismatch - --> :1:0 - | -1 | assert : -0.0 ≡ +0.0 - | ^^^^^^^^^^^^^^^^^^^^ AssertMismatch - | diff --git a/dhall/tests/type-errors/unit/AssertNotEquivalence.txt b/dhall/tests/type-errors/unit/AssertNotEquivalence.txt deleted file mode 100644 index 5973d19..0000000 --- a/dhall/tests/type-errors/unit/AssertNotEquivalence.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: AssertMustTakeEquivalence - --> :1:0 - | -1 | assert : Bool - | ^^^^^^^^^^^^^ AssertMustTakeEquivalence - | diff --git a/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt b/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt deleted file mode 100644 index 5742022..0000000 --- a/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: AssertMismatch - --> :1:0 - | -1 | assert : 1 === 2 - | ^^^^^^^^^^^^^^^^ AssertMismatch - | diff --git a/dhall/tests/type-errors/unit/CompletionMissingRequiredField.txt b/dhall/tests/type-errors/unit/CompletionMissingRequiredField.txt deleted file mode 100644 index d0a9a01..0000000 --- a/dhall/tests/type-errors/unit/CompletionMissingRequiredField.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural }) : { id : Optional Natural, name : Text } - --> :1:4 - | -... -6 | in Example::{=} - | ^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural }) : { id : Optional Natural, name : Text } - | diff --git a/dhall/tests/type-errors/unit/CompletionWithWrongDefaultType.txt b/dhall/tests/type-errors/unit/CompletionWithWrongDefaultType.txt deleted file mode 100644 index d4639e9..0000000 --- a/dhall/tests/type-errors/unit/CompletionWithWrongDefaultType.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } - --> :1:4 - | -... -6 | in Example::{=} - | ^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } - | diff --git a/dhall/tests/type-errors/unit/CompletionWithWrongFieldName.txt b/dhall/tests/type-errors/unit/CompletionWithWrongFieldName.txt deleted file mode 100644 index 0839742..0000000 --- a/dhall/tests/type-errors/unit/CompletionWithWrongFieldName.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: annot mismatch: (Example.default ⫽ { nam = "John Doe" } : { id : Optional Natural, nam : Text, name : Text }) : { id : Optional Natural, name : Text } - --> :1:4 - | -... -6 | in Example::{ nam = "John Doe" } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ { nam = "John Doe" } : { id : Optional Natural, nam : Text, name : Text }) : { id : Optional Natural, name : Text } - | diff --git a/dhall/tests/type-errors/unit/CompletionWithWrongOverridenType.txt b/dhall/tests/type-errors/unit/CompletionWithWrongOverridenType.txt deleted file mode 100644 index 7edef95..0000000 --- a/dhall/tests/type-errors/unit/CompletionWithWrongOverridenType.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: annot mismatch: (Example.default ⫽ { name = True } : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } - --> :1:4 - | -... -6 | in Example::{ name = True } - | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ { name = True } : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } - | diff --git a/dhall/tests/type-errors/unit/EmptyToMap.txt b/dhall/tests/type-errors/unit/EmptyToMap.txt deleted file mode 100644 index 000fac7..0000000 --- a/dhall/tests/type-errors/unit/EmptyToMap.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: `toMap` applied to an empty record requires a type annotation - --> :1:0 - | -1 | toMap {=} - | ^^^^^^^^^ `toMap` applied to an empty record requires a type annotation - | diff --git a/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt b/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt deleted file mode 100644 index 12e21e4..0000000 --- a/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: EquivalenceTypeMismatch - --> :1:0 - | -1 | 1 === False - | ^^^^^^^^^^^ EquivalenceTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt b/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt deleted file mode 100644 index 0183c60..0000000 --- a/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: EquivalenceArgumentsMustBeTerms - --> :1:0 - | -1 | Bool === Bool - | ^^^^^^^^^^^^^ EquivalenceArgumentsMustBeTerms - | diff --git a/dhall/tests/type-errors/unit/FunctionApplicationArgumentNotMatch.txt b/dhall/tests/type-errors/unit/FunctionApplicationArgumentNotMatch.txt deleted file mode 100644 index 07278b8..0000000 --- a/dhall/tests/type-errors/unit/FunctionApplicationArgumentNotMatch.txt +++ /dev/null @@ -1,9 +0,0 @@ -Type error: error: wrong type of function argument - --> :1:1 - | -1 | (λ(_ : Natural) → _) True - | ^^^^^^^^^^^^^^^^^^ this expects an argument of type: Natural - | ^^^^ but this has type: Bool - | - = note: expected type `Natural` - found type `Bool` diff --git a/dhall/tests/type-errors/unit/FunctionApplicationIsNotFunction.txt b/dhall/tests/type-errors/unit/FunctionApplicationIsNotFunction.txt deleted file mode 100644 index e46904a..0000000 --- a/dhall/tests/type-errors/unit/FunctionApplicationIsNotFunction.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: expected function, found `Bool` - --> :1:0 - | -1 | True True - | ^^^^ function application requires a function - | diff --git a/dhall/tests/type-errors/unit/FunctionArgumentTypeNotAType.txt b/dhall/tests/type-errors/unit/FunctionArgumentTypeNotAType.txt deleted file mode 100644 index e84eb15..0000000 --- a/dhall/tests/type-errors/unit/FunctionArgumentTypeNotAType.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: Invalid input type: `Natural` - --> :1:6 - | -1 | λ(_ : 1) → _ - | ^ this has type: `Natural` - | - = help: The input type of a function must have type `Type`, `Kind` or `Sort` diff --git a/dhall/tests/type-errors/unit/FunctionTypeArgumentTypeNotAType.txt b/dhall/tests/type-errors/unit/FunctionTypeArgumentTypeNotAType.txt deleted file mode 100644 index 4aa0f4f..0000000 --- a/dhall/tests/type-errors/unit/FunctionTypeArgumentTypeNotAType.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: Invalid input type: `Natural` - --> :1:0 - | -1 | 2 → _ - | ^ this has type: `Natural` - | - = help: The input type of a function must have type `Type`, `Kind` or `Sort` diff --git a/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt b/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt b/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/HeterogenousToMap.txt b/dhall/tests/type-errors/unit/HeterogenousToMap.txt deleted file mode 100644 index 2f8abf2..0000000 --- a/dhall/tests/type-errors/unit/HeterogenousToMap.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Every field of the record must have the same type - --> :1:0 - | -1 | toMap { foo= 1, bar= "Bar" } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Every field of the record must have the same type - | diff --git a/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt b/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt deleted file mode 100644 index d58af95..0000000 --- a/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: IfBranchMismatch - --> :1:0 - | -1 | if True then 1 else "" - | ^^^^^^^^^^^^^^^^^^^^^^ IfBranchMismatch - | diff --git a/dhall/tests/type-errors/unit/IfBranchesNotType.txt b/dhall/tests/type-errors/unit/IfBranchesNotType.txt deleted file mode 100644 index b70ac5f..0000000 --- a/dhall/tests/type-errors/unit/IfBranchesNotType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: IfBranchMustBeTerm - --> :1:0 - | -1 | if True then Type else Type - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ IfBranchMustBeTerm - | diff --git a/dhall/tests/type-errors/unit/IfNotBool.txt b/dhall/tests/type-errors/unit/IfNotBool.txt deleted file mode 100644 index eb5ff42..0000000 --- a/dhall/tests/type-errors/unit/IfNotBool.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidPredicate - --> :1:0 - | -1 | if 1 then 1 else 1 - | ^^^^^^^^^^^^^^^^^^ InvalidPredicate - | diff --git a/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt b/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt deleted file mode 100644 index 5ba4b35..0000000 --- a/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: annot mismatch: (True : Bool) : Natural - --> :1:8 - | -1 | let x : Natural = True in True - | ^^^^^^^ annot mismatch: (True : Bool) : Natural - | diff --git a/dhall/tests/type-errors/unit/ListLiteralEmptyNotType.txt b/dhall/tests/type-errors/unit/ListLiteralEmptyNotType.txt deleted file mode 100644 index 2ca5819..0000000 --- a/dhall/tests/type-errors/unit/ListLiteralEmptyNotType.txt +++ /dev/null @@ -1,9 +0,0 @@ -Type error: error: wrong type of function argument - --> :1:5 - | -1 | [] : List Type - | ^^^^ this expects an argument of type: Type - | ^^^^ but this has type: Kind - | - = note: expected type `Type` - found type `Kind` diff --git a/dhall/tests/type-errors/unit/ListLiteralNotType.txt b/dhall/tests/type-errors/unit/ListLiteralNotType.txt deleted file mode 100644 index 62d69e5..0000000 --- a/dhall/tests/type-errors/unit/ListLiteralNotType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidListType - --> :1:0 - | -1 | [ Bool ] - | ^^^^^^^^ InvalidListType - | diff --git a/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt b/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt deleted file mode 100644 index 33e007d..0000000 --- a/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidListElement - --> :1:0 - | -1 | [ True, 1 ] - | ^^^^^^^^^^^ InvalidListElement - | diff --git a/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt b/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt deleted file mode 100644 index a4a967a..0000000 --- a/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeVariantMissingHandler - --> :1:0 - | -1 | merge {=} (< x : Bool >.x True) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeVariantMissingHandler - | diff --git a/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt b/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt deleted file mode 100644 index 9175f33..0000000 --- a/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeAnnotMismatch - --> :1:0 - | -1 | merge { x = 0 } < x >.x : Bool - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeAnnotMismatch - | diff --git a/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt b/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt deleted file mode 100644 index 1173f0c..0000000 --- a/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Merge2ArgMustBeUnionOrOptional - --> :1:0 - | -1 | merge {=} <> : Type - | ^^^^^^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional - | diff --git a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt deleted file mode 100644 index 94442e0..0000000 --- a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeEmptyNeedsAnnotation - --> :1:13 - | -1 | \(x: <>) -> (merge {=} x) : Bool - | ^^^^^^^^^^^ MergeEmptyNeedsAnnotation - | diff --git a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt deleted file mode 100644 index 5dcffdf..0000000 --- a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeEmptyNeedsAnnotation - --> :1:26 - | -1 | \(x: <>) -> let y: Bool = merge {=} x in 1 - | ^^^^^^^^^^^ MergeEmptyNeedsAnnotation - | diff --git a/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt b/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt deleted file mode 100644 index bf45123..0000000 --- a/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Merge2ArgMustBeUnionOrOptional - --> :1:0 - | -1 | merge {=} <> - | ^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional - | diff --git a/dhall/tests/type-errors/unit/MergeHandlerNotFunction.txt b/dhall/tests/type-errors/unit/MergeHandlerNotFunction.txt deleted file mode 100644 index 8528f90..0000000 --- a/dhall/tests/type-errors/unit/MergeHandlerNotFunction.txt +++ /dev/null @@ -1,9 +0,0 @@ -Type error: error: merge handler is not a function - --> :1:0 - | -1 | merge { x = True } (< x : Bool >.x True) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this merge expression - | ^^^^^^^^^^^^ the handler for `x` has type: `Bool` - | ------------------- help: the corresponding variant has type: `Bool` - | - = help: a handler for this variant must be a function that takes an input of type: `Bool` diff --git a/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt b/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt deleted file mode 100644 index 3159340..0000000 --- a/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Merge2ArgMustBeUnionOrOptional - --> :1:0 - | -1 | merge { x = λ(_ : Bool) → _ } <> : Bool - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional - | diff --git a/dhall/tests/type-errors/unit/MergeHandlerNotMatchAlternativeType.txt b/dhall/tests/type-errors/unit/MergeHandlerNotMatchAlternativeType.txt deleted file mode 100644 index c2229bd..0000000 --- a/dhall/tests/type-errors/unit/MergeHandlerNotMatchAlternativeType.txt +++ /dev/null @@ -1,8 +0,0 @@ -Type error: error: Wrong handler input type - --> :1:0 - | -1 | merge { x = λ(_ : Bool) → _ } (< x : Natural >.x 1) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this merge expression - | ^^^^^^^^^^^^^^^^^^^^^^^ the handler for `x` expects a value of type: `Bool` - | ^^^^^^^^^^^^^^^^^^^ but the corresponding variant has type: `Natural` - | diff --git a/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt b/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt deleted file mode 100644 index 47f3de7..0000000 --- a/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeHandlerTypeMismatch - --> :1:0 - | -1 | merge { x = λ(_ : Bool) → _, y = λ(_ : Natural) → _ } (< x : Bool | y : Natural >.x True) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeHandlerTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt deleted file mode 100644 index f27dddd..0000000 --- a/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Merge1ArgMustBeRecord - --> :1:0 - | -1 | merge True < x >.x - | ^^^^^^^^^^^^^^^^^^ Merge1ArgMustBeRecord - | diff --git a/dhall/tests/type-errors/unit/MergeMissingHandler1.txt b/dhall/tests/type-errors/unit/MergeMissingHandler1.txt deleted file mode 100644 index af58d05..0000000 --- a/dhall/tests/type-errors/unit/MergeMissingHandler1.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeVariantMissingHandler - --> :1:0 - | -1 | merge {=} .x - | ^^^^^^^^^^^^^^^ MergeVariantMissingHandler - | diff --git a/dhall/tests/type-errors/unit/MergeMissingHandler2.txt b/dhall/tests/type-errors/unit/MergeMissingHandler2.txt deleted file mode 100644 index 49484df..0000000 --- a/dhall/tests/type-errors/unit/MergeMissingHandler2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeVariantMissingHandler - --> :1:0 - | -1 | merge { x = 0 } .x - | ^^^^^^^^^^^^^^^^^^^^^^^^^ MergeVariantMissingHandler - | diff --git a/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt b/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt deleted file mode 100644 index 0108725..0000000 --- a/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Merge2ArgMustBeUnionOrOptional - --> :1:0 - | -1 | merge {=} True - | ^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional - | diff --git a/dhall/tests/type-errors/unit/MergeUnusedHandler.txt b/dhall/tests/type-errors/unit/MergeUnusedHandler.txt deleted file mode 100644 index 2afe376..0000000 --- a/dhall/tests/type-errors/unit/MergeUnusedHandler.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MergeHandlerMissingVariant - --> :1:0 - | -1 | merge { x = 1, y = 2 } < x >.x - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeHandlerMissingVariant - | diff --git a/dhall/tests/type-errors/unit/MistypedToMap1.txt b/dhall/tests/type-errors/unit/MistypedToMap1.txt deleted file mode 100644 index 14d9791..0000000 --- a/dhall/tests/type-errors/unit/MistypedToMap1.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Annotation mismatch - --> :1:0 - | -1 | toMap { foo= 1, bar= 4 } : Natural - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch - | diff --git a/dhall/tests/type-errors/unit/MistypedToMap2.txt b/dhall/tests/type-errors/unit/MistypedToMap2.txt deleted file mode 100644 index 88e303e..0000000 --- a/dhall/tests/type-errors/unit/MistypedToMap2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Annotation mismatch - --> :1:0 - | -1 | toMap { foo= 1, bar= 4 } : List Natural - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch - | diff --git a/dhall/tests/type-errors/unit/MistypedToMap3.txt b/dhall/tests/type-errors/unit/MistypedToMap3.txt deleted file mode 100644 index 6b3772d..0000000 --- a/dhall/tests/type-errors/unit/MistypedToMap3.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Annotation mismatch - --> :1:0 - | -1 | toMap { foo= 1, bar= 4 } : List { mapKey : Natural, mapValue : Natural } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch - | diff --git a/dhall/tests/type-errors/unit/MistypedToMap4.txt b/dhall/tests/type-errors/unit/MistypedToMap4.txt deleted file mode 100644 index e0cf651..0000000 --- a/dhall/tests/type-errors/unit/MistypedToMap4.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: Annotation mismatch - --> :1:0 - | -1 | toMap { foo= 1, bar= 4 } : List { mapKey : Text, mapValue : Text } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch - | diff --git a/dhall/tests/type-errors/unit/NaturalSubtractNotNatural.txt b/dhall/tests/type-errors/unit/NaturalSubtractNotNatural.txt deleted file mode 100644 index ac336a6..0000000 --- a/dhall/tests/type-errors/unit/NaturalSubtractNotNatural.txt +++ /dev/null @@ -1,9 +0,0 @@ -Type error: error: wrong type of function argument - --> :1:0 - | -1 | Natural/subtract True True - | ^^^^^^^^^^^^^^^^ this expects an argument of type: Natural - | ^^^^ but this has type: Bool - | - = note: expected type `Natural` - found type `Bool` diff --git a/dhall/tests/type-errors/unit/NonRecordToMap.txt b/dhall/tests/type-errors/unit/NonRecordToMap.txt deleted file mode 100644 index 8e83002..0000000 --- a/dhall/tests/type-errors/unit/NonRecordToMap.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: The argument to `toMap` must be a record - --> :1:0 - | -1 | toMap "text" - | ^^^^^^^^^^^^ The argument to `toMap` must be a record - | diff --git a/dhall/tests/type-errors/unit/OperatorAndNotBool.txt b/dhall/tests/type-errors/unit/OperatorAndNotBool.txt deleted file mode 100644 index f6ea50b..0000000 --- a/dhall/tests/type-errors/unit/OperatorAndNotBool.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 && 1 - | ^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt b/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt deleted file mode 100644 index 8662c16..0000000 --- a/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 == 1 - | ^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt deleted file mode 100644 index 8075b99..0000000 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 # [ True ] - | ^^^^^^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt deleted file mode 100644 index 9e404f8..0000000 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | [ True ] # [ 1 ] - | ^^^^^^^^^^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt deleted file mode 100644 index fffc898..0000000 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 # 2 - | ^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt deleted file mode 100644 index 2ba0b91..0000000 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | [ True ] # 1 - | ^^^^^^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt b/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt deleted file mode 100644 index ac04fd4..0000000 --- a/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 != 1 - | ^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorOrNotBool.txt b/dhall/tests/type-errors/unit/OperatorOrNotBool.txt deleted file mode 100644 index 9e1c4fb..0000000 --- a/dhall/tests/type-errors/unit/OperatorOrNotBool.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 || 1 - | ^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt b/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt deleted file mode 100644 index 97e0df4..0000000 --- a/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | True + True - | ^^^^^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt b/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt deleted file mode 100644 index 679d991..0000000 --- a/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | 1 ++ "" - | ^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt b/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt deleted file mode 100644 index 85611f7..0000000 --- a/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | "" ++ 1 - | ^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt b/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt deleted file mode 100644 index d688ed6..0000000 --- a/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: BinOpTypeMismatch - --> :1:0 - | -1 | True * True - | ^^^^^^^^^^^ BinOpTypeMismatch - | diff --git a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt deleted file mode 100644 index bfb36ae..0000000 --- a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidListType - --> :1:0 - | -1 | [] : Optional Bool - | ^^^^^^^^^^^^^^^^^^ InvalidListType - | diff --git a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt deleted file mode 100644 index 5332fcb..0000000 --- a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: annot mismatch: ([1] : List Natural) : Optional Natural - --> :1:0 - | -1 | [ 1 ] : Optional Natural - | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ([1] : List Natural) : Optional Natural - | diff --git a/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt deleted file mode 100644 index 608c6a0..0000000 --- a/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: RecordTypeDuplicateField - --> :1:0 - | -1 | { x = 0, x = 0 } - | ^^^^^^^^^^^^^^^^ RecordTypeDuplicateField - | diff --git a/dhall/tests/type-errors/unit/RecordMixedKinds3.txt b/dhall/tests/type-errors/unit/RecordMixedKinds3.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/RecordMixedKinds3.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RecordProjectionByTypeFieldTypeMismatch.txt b/dhall/tests/type-errors/unit/RecordProjectionByTypeFieldTypeMismatch.txt deleted file mode 100644 index d624075..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionByTypeFieldTypeMismatch.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionWrongType - --> :1:0 - | -1 | { y = {=} }.( {y : Natural} ) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ProjectionWrongType - | diff --git a/dhall/tests/type-errors/unit/RecordProjectionByTypeNotPresent.txt b/dhall/tests/type-errors/unit/RecordProjectionByTypeNotPresent.txt deleted file mode 100644 index c22c2c4..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionByTypeNotPresent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionMissingEntry - --> :1:0 - | -1 | { y = {=} }.( {x : Natural} ) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ProjectionMissingEntry - | diff --git a/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt deleted file mode 100644 index 5c6520b..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionDuplicateField - --> :1:0 - | -1 | { x = 1 }.{ x, x } - | ^^^^^^^^^^^^^^^^^^ ProjectionDuplicateField - | diff --git a/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt b/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt deleted file mode 100644 index 39f263b..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionMissingEntry - --> :1:0 - | -1 | {=}.{ x } - | ^^^^^^^^^ ProjectionMissingEntry - | diff --git a/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt b/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt deleted file mode 100644 index 032f7a0..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionMissingEntry - --> :1:0 - | -1 | { y = {=} }.{ x } - | ^^^^^^^^^^^^^^^^^ ProjectionMissingEntry - | diff --git a/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt b/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt deleted file mode 100644 index 5ed6ffd..0000000 --- a/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: ProjectionMustBeRecord - --> :1:0 - | -1 | True.{ x } - | ^^^^^^^^^^ ProjectionMustBeRecord - | diff --git a/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt b/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt deleted file mode 100644 index 5b3b7f8..0000000 --- a/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MissingRecordField - --> :1:0 - | -1 | {=}.x - | ^^^^^ MissingRecordField - | diff --git a/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt b/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt deleted file mode 100644 index d435ca0..0000000 --- a/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MissingRecordField - --> :1:0 - | -1 | { y = {=} }.x - | ^^^^^^^^^^^^^ MissingRecordField - | diff --git a/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt b/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt deleted file mode 100644 index 3f9b7ed..0000000 --- a/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: NotARecord - --> :1:0 - | -1 | True.x - | ^^^^^^ NotARecord - | diff --git a/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt b/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt deleted file mode 100644 index cca28b8..0000000 --- a/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: NotARecord - --> :1:0 - | -1 | Bool.x - | ^^^^^^ NotARecord - | diff --git a/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt deleted file mode 100644 index 145a59b..0000000 --- a/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: RecordTypeDuplicateField - --> :1:0 - | -1 | { x: Natural, x: Natural } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ RecordTypeDuplicateField - | diff --git a/dhall/tests/type-errors/unit/RecordTypeValueMember.txt b/dhall/tests/type-errors/unit/RecordTypeValueMember.txt deleted file mode 100644 index 04488ad..0000000 --- a/dhall/tests/type-errors/unit/RecordTypeValueMember.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | { x : True } - | ^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt deleted file mode 100644 index f74e839..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt deleted file mode 100644 index f74e839..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt deleted file mode 100644 index f74e839..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt deleted file mode 100644 index b35e64b..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType - --> :1:0 - | -1 | Bool ⩓ {} - | ^^^^^^^^^ RecordTypeMergeRequiresRecordType - | diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt deleted file mode 100644 index f74e839..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt deleted file mode 100644 index 0200f97..0000000 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: RecordTypeMergeRequiresRecordType - --> :1:0 - | -1 | {} ⩓ Bool - | ^^^^^^^^^ RecordTypeMergeRequiresRecordType - | diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt deleted file mode 100644 index 3b158ce..0000000 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MustCombineRecord - --> :1:0 - | -1 | True ⫽ {=} - | ^^^^^^^^^^ MustCombineRecord - | diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt deleted file mode 100644 index 4f9cb0d..0000000 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MustCombineRecord - --> :1:0 - | -1 | {=} ⫽ True - | ^^^^^^^^^^ MustCombineRecord - | diff --git a/dhall/tests/type-errors/unit/SomeNotType.txt b/dhall/tests/type-errors/unit/SomeNotType.txt deleted file mode 100644 index 3584768..0000000 --- a/dhall/tests/type-errors/unit/SomeNotType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidOptionalType - --> :1:0 - | -1 | Some Bool - | ^^^^^^^^^ InvalidOptionalType - | diff --git a/dhall/tests/type-errors/unit/Sort.txt b/dhall/tests/type-errors/unit/Sort.txt deleted file mode 100644 index 5b88ff7..0000000 --- a/dhall/tests/type-errors/unit/Sort.txt +++ /dev/null @@ -1 +0,0 @@ -Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt b/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt deleted file mode 100644 index 0132a30..0000000 --- a/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidTextInterpolation - --> :1:0 - | -1 | "${1}" - | ^^^^^^ InvalidTextInterpolation - | diff --git a/dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt b/dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt deleted file mode 100644 index c28073e..0000000 --- a/dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type error: error: The type of `toMap x` must be of the form `List { mapKey : Text, mapValue : T }` - --> :2:0 - | -1 | -- The mapKey must be Text -2 | toMap {=} : List { mapKey : Bool, mapValue : Text } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type of `toMap x` must be of the form `List { mapKey : Text, mapValue : T }` - | diff --git a/dhall/tests/type-errors/unit/ToMapWrongKind.txt b/dhall/tests/type-errors/unit/ToMapWrongKind.txt deleted file mode 100644 index 8158c08..0000000 --- a/dhall/tests/type-errors/unit/ToMapWrongKind.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: `toMap` only accepts records of type `Type` - --> :1:0 - | -1 | toMap { x = Bool } - | ^^^^^^^^^^^^^^^^^^ `toMap` only accepts records of type `Type` - | diff --git a/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt b/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt deleted file mode 100644 index 7360e68..0000000 --- a/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: annot mismatch: (1 : Natural) : Bool - --> :1:0 - | -1 | 1 : Bool - | ^^^^^^^^ annot mismatch: (1 : Natural) : Bool - | diff --git a/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt b/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt deleted file mode 100644 index 41d283d..0000000 --- a/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: MissingUnionField - --> :1:0 - | -1 | < x : Bool >.y - | ^^^^^^^^^^^^^^ MissingUnionField - | diff --git a/dhall/tests/type-errors/unit/UnionDeprecatedConstructorsKeyword.txt b/dhall/tests/type-errors/unit/UnionDeprecatedConstructorsKeyword.txt deleted file mode 100644 index 91fb96d..0000000 --- a/dhall/tests/type-errors/unit/UnionDeprecatedConstructorsKeyword.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: unbound variable `constructors` - --> :1:0 - | -1 | constructors < Left : Natural | Right : Bool > - | ^^^^^^^^^^^^ not found in this scope - | diff --git a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt deleted file mode 100644 index 7372641..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: UnionTypeDuplicateField - --> :1:0 - | -1 | - | ^^^^^^^ UnionTypeDuplicateField - | diff --git a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt deleted file mode 100644 index 07042c2..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: UnionTypeDuplicateField - --> :1:0 - | -1 | - | ^^^^^^^^^^^^^^^^ UnionTypeDuplicateField - | diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt deleted file mode 100644 index 00e24b3..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | < x : Bool | y : Type > - | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt deleted file mode 100644 index 924b1e1..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | < x : Kind | y : Type > - | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt deleted file mode 100644 index 1113a0d..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | < x : Kind | y : Bool > - | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/unit/UnionTypeNotType.txt b/dhall/tests/type-errors/unit/UnionTypeNotType.txt deleted file mode 100644 index b2c06e0..0000000 --- a/dhall/tests/type-errors/unit/UnionTypeNotType.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:0 - | -1 | < x : True > - | ^^^^^^^^^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-errors/unit/VariableFree.txt b/dhall/tests/type-errors/unit/VariableFree.txt deleted file mode 100644 index db78e15..0000000 --- a/dhall/tests/type-errors/unit/VariableFree.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: unbound variable `x` - --> :1:0 - | -1 | x - | ^ not found in this scope - | diff --git a/dhall/tests/type-inference/failure/SortInLet.txt b/dhall/tests/type-inference/failure/SortInLet.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/SortInLet.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/hurkensParadox.txt b/dhall/tests/type-inference/failure/hurkensParadox.txt new file mode 100644 index 0000000..6b99615 --- /dev/null +++ b/dhall/tests/type-inference/failure/hurkensParadox.txt @@ -0,0 +1,15 @@ +Type error: error: wrong type of function argument + --> :6:23 + | + 1 | let bottom : Type = ∀(any : Type) → any + 2 | + 3 | in let not : Type → Type = λ(p : Type) → p → bottom + 4 | +... +10 | : pow (pow U) → U +11 | = λ(t : pow (pow U)) + | ^^^ this expects an argument of type: Kind + | ^ but this has type: Sort + | + = note: expected type `Kind` + found type `Sort` diff --git a/dhall/tests/type-inference/failure/mixedUnions.txt b/dhall/tests/type-inference/failure/mixedUnions.txt new file mode 100644 index 0000000..8e0026d --- /dev/null +++ b/dhall/tests/type-inference/failure/mixedUnions.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | < Left : Natural | Right : Type > + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/recordOfKind.txt b/dhall/tests/type-inference/failure/recordOfKind.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/recordOfKind.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldName.txt b/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldName.txt new file mode 100644 index 0000000..2a754fc --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldName.txt @@ -0,0 +1,6 @@ +Type error: error: annot mismatch: ({ x = 1 } : { x : Natural }) : { y : Natural } + --> :1:0 + | +1 | { x = 1 } : { y : Natural } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ({ x = 1 } : { x : Natural }) : { y : Natural } + | diff --git a/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldType.txt b/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldType.txt new file mode 100644 index 0000000..e67edb8 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AnnotationRecordWrongFieldType.txt @@ -0,0 +1,6 @@ +Type error: error: annot mismatch: ({ x = 1 } : { x : Natural }) : { x : Text } + --> :1:0 + | +1 | { x = 1 } : { x : Text } + | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ({ x = 1 } : { x : Natural }) : { x : Text } + | diff --git a/dhall/tests/type-inference/failure/unit/AssertAlphaTrap.txt b/dhall/tests/type-inference/failure/unit/AssertAlphaTrap.txt new file mode 100644 index 0000000..7e27d00 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AssertAlphaTrap.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable ``_`` + --> :1:46 + | +1 | assert : (\(_: Bool) -> _) === (\(x: Bool) -> _) + | ^ not found in this scope + | diff --git a/dhall/tests/type-inference/failure/unit/AssertDoubleZeros.txt b/dhall/tests/type-inference/failure/unit/AssertDoubleZeros.txt new file mode 100644 index 0000000..12231a0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AssertDoubleZeros.txt @@ -0,0 +1,6 @@ +Type error: error: AssertMismatch + --> :1:0 + | +1 | assert : -0.0 ≡ +0.0 + | ^^^^^^^^^^^^^^^^^^^^ AssertMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/AssertNotEquivalence.txt b/dhall/tests/type-inference/failure/unit/AssertNotEquivalence.txt new file mode 100644 index 0000000..5973d19 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AssertNotEquivalence.txt @@ -0,0 +1,6 @@ +Type error: error: AssertMustTakeEquivalence + --> :1:0 + | +1 | assert : Bool + | ^^^^^^^^^^^^^ AssertMustTakeEquivalence + | diff --git a/dhall/tests/type-inference/failure/unit/AssertTriviallyFalse.txt b/dhall/tests/type-inference/failure/unit/AssertTriviallyFalse.txt new file mode 100644 index 0000000..5742022 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/AssertTriviallyFalse.txt @@ -0,0 +1,6 @@ +Type error: error: AssertMismatch + --> :1:0 + | +1 | assert : 1 === 2 + | ^^^^^^^^^^^^^^^^ AssertMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/CompletionMissingRequiredField.txt b/dhall/tests/type-inference/failure/unit/CompletionMissingRequiredField.txt new file mode 100644 index 0000000..d0a9a01 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/CompletionMissingRequiredField.txt @@ -0,0 +1,7 @@ +Type error: error: annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural }) : { id : Optional Natural, name : Text } + --> :1:4 + | +... +6 | in Example::{=} + | ^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural }) : { id : Optional Natural, name : Text } + | diff --git a/dhall/tests/type-inference/failure/unit/CompletionWithWrongDefaultType.txt b/dhall/tests/type-inference/failure/unit/CompletionWithWrongDefaultType.txt new file mode 100644 index 0000000..d4639e9 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/CompletionWithWrongDefaultType.txt @@ -0,0 +1,7 @@ +Type error: error: annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } + --> :1:4 + | +... +6 | in Example::{=} + | ^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ {=} : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } + | diff --git a/dhall/tests/type-inference/failure/unit/CompletionWithWrongFieldName.txt b/dhall/tests/type-inference/failure/unit/CompletionWithWrongFieldName.txt new file mode 100644 index 0000000..0839742 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/CompletionWithWrongFieldName.txt @@ -0,0 +1,7 @@ +Type error: error: annot mismatch: (Example.default ⫽ { nam = "John Doe" } : { id : Optional Natural, nam : Text, name : Text }) : { id : Optional Natural, name : Text } + --> :1:4 + | +... +6 | in Example::{ nam = "John Doe" } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ { nam = "John Doe" } : { id : Optional Natural, nam : Text, name : Text }) : { id : Optional Natural, name : Text } + | diff --git a/dhall/tests/type-inference/failure/unit/CompletionWithWrongOverridenType.txt b/dhall/tests/type-inference/failure/unit/CompletionWithWrongOverridenType.txt new file mode 100644 index 0000000..7edef95 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/CompletionWithWrongOverridenType.txt @@ -0,0 +1,7 @@ +Type error: error: annot mismatch: (Example.default ⫽ { name = True } : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } + --> :1:4 + | +... +6 | in Example::{ name = True } + | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: (Example.default ⫽ { name = True } : { id : Optional Natural, name : Bool }) : { id : Optional Natural, name : Text } + | diff --git a/dhall/tests/type-inference/failure/unit/EmptyToMap.txt b/dhall/tests/type-inference/failure/unit/EmptyToMap.txt new file mode 100644 index 0000000..000fac7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/EmptyToMap.txt @@ -0,0 +1,6 @@ +Type error: error: `toMap` applied to an empty record requires a type annotation + --> :1:0 + | +1 | toMap {=} + | ^^^^^^^^^ `toMap` applied to an empty record requires a type annotation + | diff --git a/dhall/tests/type-inference/failure/unit/EquivalenceNotSameType.txt b/dhall/tests/type-inference/failure/unit/EquivalenceNotSameType.txt new file mode 100644 index 0000000..12e21e4 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/EquivalenceNotSameType.txt @@ -0,0 +1,6 @@ +Type error: error: EquivalenceTypeMismatch + --> :1:0 + | +1 | 1 === False + | ^^^^^^^^^^^ EquivalenceTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/EquivalenceNotTerms.txt b/dhall/tests/type-inference/failure/unit/EquivalenceNotTerms.txt new file mode 100644 index 0000000..0183c60 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/EquivalenceNotTerms.txt @@ -0,0 +1,6 @@ +Type error: error: EquivalenceArgumentsMustBeTerms + --> :1:0 + | +1 | Bool === Bool + | ^^^^^^^^^^^^^ EquivalenceArgumentsMustBeTerms + | diff --git a/dhall/tests/type-inference/failure/unit/FunctionApplicationArgumentNotMatch.txt b/dhall/tests/type-inference/failure/unit/FunctionApplicationArgumentNotMatch.txt new file mode 100644 index 0000000..07278b8 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionApplicationArgumentNotMatch.txt @@ -0,0 +1,9 @@ +Type error: error: wrong type of function argument + --> :1:1 + | +1 | (λ(_ : Natural) → _) True + | ^^^^^^^^^^^^^^^^^^ this expects an argument of type: Natural + | ^^^^ but this has type: Bool + | + = note: expected type `Natural` + found type `Bool` diff --git a/dhall/tests/type-inference/failure/unit/FunctionApplicationIsNotFunction.txt b/dhall/tests/type-inference/failure/unit/FunctionApplicationIsNotFunction.txt new file mode 100644 index 0000000..e46904a --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionApplicationIsNotFunction.txt @@ -0,0 +1,6 @@ +Type error: error: expected function, found `Bool` + --> :1:0 + | +1 | True True + | ^^^^ function application requires a function + | diff --git a/dhall/tests/type-inference/failure/unit/FunctionArgumentTypeNotAType.txt b/dhall/tests/type-inference/failure/unit/FunctionArgumentTypeNotAType.txt new file mode 100644 index 0000000..e84eb15 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionArgumentTypeNotAType.txt @@ -0,0 +1,7 @@ +Type error: error: Invalid input type: `Natural` + --> :1:6 + | +1 | λ(_ : 1) → _ + | ^ this has type: `Natural` + | + = help: The input type of a function must have type `Type`, `Kind` or `Sort` diff --git a/dhall/tests/type-inference/failure/unit/FunctionTypeArgumentTypeNotAType.txt b/dhall/tests/type-inference/failure/unit/FunctionTypeArgumentTypeNotAType.txt new file mode 100644 index 0000000..4aa0f4f --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionTypeArgumentTypeNotAType.txt @@ -0,0 +1,7 @@ +Type error: error: Invalid input type: `Natural` + --> :1:0 + | +1 | 2 → _ + | ^ this has type: `Natural` + | + = help: The input type of a function must have type `Type`, `Kind` or `Sort` diff --git a/dhall/tests/type-inference/failure/unit/FunctionTypeKindSort.txt b/dhall/tests/type-inference/failure/unit/FunctionTypeKindSort.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionTypeKindSort.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/FunctionTypeTypeSort.txt b/dhall/tests/type-inference/failure/unit/FunctionTypeTypeSort.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/FunctionTypeTypeSort.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/HeterogenousToMap.txt b/dhall/tests/type-inference/failure/unit/HeterogenousToMap.txt new file mode 100644 index 0000000..2f8abf2 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/HeterogenousToMap.txt @@ -0,0 +1,6 @@ +Type error: error: Every field of the record must have the same type + --> :1:0 + | +1 | toMap { foo= 1, bar= "Bar" } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Every field of the record must have the same type + | diff --git a/dhall/tests/type-inference/failure/unit/IfBranchesNotMatch.txt b/dhall/tests/type-inference/failure/unit/IfBranchesNotMatch.txt new file mode 100644 index 0000000..d58af95 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/IfBranchesNotMatch.txt @@ -0,0 +1,6 @@ +Type error: error: IfBranchMismatch + --> :1:0 + | +1 | if True then 1 else "" + | ^^^^^^^^^^^^^^^^^^^^^^ IfBranchMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/IfBranchesNotType.txt b/dhall/tests/type-inference/failure/unit/IfBranchesNotType.txt new file mode 100644 index 0000000..b70ac5f --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/IfBranchesNotType.txt @@ -0,0 +1,6 @@ +Type error: error: IfBranchMustBeTerm + --> :1:0 + | +1 | if True then Type else Type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ IfBranchMustBeTerm + | diff --git a/dhall/tests/type-inference/failure/unit/IfNotBool.txt b/dhall/tests/type-inference/failure/unit/IfNotBool.txt new file mode 100644 index 0000000..eb5ff42 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/IfNotBool.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidPredicate + --> :1:0 + | +1 | if 1 then 1 else 1 + | ^^^^^^^^^^^^^^^^^^ InvalidPredicate + | diff --git a/dhall/tests/type-inference/failure/unit/LetWithWrongAnnotation.txt b/dhall/tests/type-inference/failure/unit/LetWithWrongAnnotation.txt new file mode 100644 index 0000000..5ba4b35 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/LetWithWrongAnnotation.txt @@ -0,0 +1,6 @@ +Type error: error: annot mismatch: (True : Bool) : Natural + --> :1:8 + | +1 | let x : Natural = True in True + | ^^^^^^^ annot mismatch: (True : Bool) : Natural + | diff --git a/dhall/tests/type-inference/failure/unit/ListLiteralEmptyNotType.txt b/dhall/tests/type-inference/failure/unit/ListLiteralEmptyNotType.txt new file mode 100644 index 0000000..2ca5819 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/ListLiteralEmptyNotType.txt @@ -0,0 +1,9 @@ +Type error: error: wrong type of function argument + --> :1:5 + | +1 | [] : List Type + | ^^^^ this expects an argument of type: Type + | ^^^^ but this has type: Kind + | + = note: expected type `Type` + found type `Kind` diff --git a/dhall/tests/type-inference/failure/unit/ListLiteralNotType.txt b/dhall/tests/type-inference/failure/unit/ListLiteralNotType.txt new file mode 100644 index 0000000..62d69e5 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/ListLiteralNotType.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidListType + --> :1:0 + | +1 | [ Bool ] + | ^^^^^^^^ InvalidListType + | diff --git a/dhall/tests/type-inference/failure/unit/ListLiteralTypesNotMatch.txt b/dhall/tests/type-inference/failure/unit/ListLiteralTypesNotMatch.txt new file mode 100644 index 0000000..33e007d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/ListLiteralTypesNotMatch.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidListElement + --> :1:0 + | +1 | [ True, 1 ] + | ^^^^^^^^^^^ InvalidListElement + | diff --git a/dhall/tests/type-inference/failure/unit/MergeAlternativeHasNoHandler.txt b/dhall/tests/type-inference/failure/unit/MergeAlternativeHasNoHandler.txt new file mode 100644 index 0000000..a4a967a --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeAlternativeHasNoHandler.txt @@ -0,0 +1,6 @@ +Type error: error: MergeVariantMissingHandler + --> :1:0 + | +1 | merge {=} (< x : Bool >.x True) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeVariantMissingHandler + | diff --git a/dhall/tests/type-inference/failure/unit/MergeAnnotationMismatch.txt b/dhall/tests/type-inference/failure/unit/MergeAnnotationMismatch.txt new file mode 100644 index 0000000..9175f33 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeAnnotationMismatch.txt @@ -0,0 +1,6 @@ +Type error: error: MergeAnnotMismatch + --> :1:0 + | +1 | merge { x = 0 } < x >.x : Bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeAnnotMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/MergeAnnotationNotType.txt b/dhall/tests/type-inference/failure/unit/MergeAnnotationNotType.txt new file mode 100644 index 0000000..1173f0c --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeAnnotationNotType.txt @@ -0,0 +1,6 @@ +Type error: error: Merge2ArgMustBeUnionOrOptional + --> :1:0 + | +1 | merge {=} <> : Type + | ^^^^^^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional + | diff --git a/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation1.txt b/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation1.txt new file mode 100644 index 0000000..94442e0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation1.txt @@ -0,0 +1,6 @@ +Type error: error: MergeEmptyNeedsAnnotation + --> :1:13 + | +1 | \(x: <>) -> (merge {=} x) : Bool + | ^^^^^^^^^^^ MergeEmptyNeedsAnnotation + | diff --git a/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation2.txt b/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation2.txt new file mode 100644 index 0000000..5dcffdf --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeEmptyNeedsDirectAnnotation2.txt @@ -0,0 +1,6 @@ +Type error: error: MergeEmptyNeedsAnnotation + --> :1:26 + | +1 | \(x: <>) -> let y: Bool = merge {=} x in 1 + | ^^^^^^^^^^^ MergeEmptyNeedsAnnotation + | diff --git a/dhall/tests/type-inference/failure/unit/MergeEmptyWithoutAnnotation.txt b/dhall/tests/type-inference/failure/unit/MergeEmptyWithoutAnnotation.txt new file mode 100644 index 0000000..bf45123 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeEmptyWithoutAnnotation.txt @@ -0,0 +1,6 @@ +Type error: error: Merge2ArgMustBeUnionOrOptional + --> :1:0 + | +1 | merge {=} <> + | ^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional + | diff --git a/dhall/tests/type-inference/failure/unit/MergeHandlerNotFunction.txt b/dhall/tests/type-inference/failure/unit/MergeHandlerNotFunction.txt new file mode 100644 index 0000000..8528f90 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeHandlerNotFunction.txt @@ -0,0 +1,9 @@ +Type error: error: merge handler is not a function + --> :1:0 + | +1 | merge { x = True } (< x : Bool >.x True) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this merge expression + | ^^^^^^^^^^^^ the handler for `x` has type: `Bool` + | ------------------- help: the corresponding variant has type: `Bool` + | + = help: a handler for this variant must be a function that takes an input of type: `Bool` diff --git a/dhall/tests/type-inference/failure/unit/MergeHandlerNotInUnion.txt b/dhall/tests/type-inference/failure/unit/MergeHandlerNotInUnion.txt new file mode 100644 index 0000000..3159340 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeHandlerNotInUnion.txt @@ -0,0 +1,6 @@ +Type error: error: Merge2ArgMustBeUnionOrOptional + --> :1:0 + | +1 | merge { x = λ(_ : Bool) → _ } <> : Bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional + | diff --git a/dhall/tests/type-inference/failure/unit/MergeHandlerNotMatchAlternativeType.txt b/dhall/tests/type-inference/failure/unit/MergeHandlerNotMatchAlternativeType.txt new file mode 100644 index 0000000..c2229bd --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeHandlerNotMatchAlternativeType.txt @@ -0,0 +1,8 @@ +Type error: error: Wrong handler input type + --> :1:0 + | +1 | merge { x = λ(_ : Bool) → _ } (< x : Natural >.x 1) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this merge expression + | ^^^^^^^^^^^^^^^^^^^^^^^ the handler for `x` expects a value of type: `Bool` + | ^^^^^^^^^^^^^^^^^^^ but the corresponding variant has type: `Natural` + | diff --git a/dhall/tests/type-inference/failure/unit/MergeHandlersWithDifferentType.txt b/dhall/tests/type-inference/failure/unit/MergeHandlersWithDifferentType.txt new file mode 100644 index 0000000..47f3de7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeHandlersWithDifferentType.txt @@ -0,0 +1,6 @@ +Type error: error: MergeHandlerTypeMismatch + --> :1:0 + | +1 | merge { x = λ(_ : Bool) → _, y = λ(_ : Natural) → _ } (< x : Bool | y : Natural >.x True) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeHandlerTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/MergeLhsNotRecord.txt b/dhall/tests/type-inference/failure/unit/MergeLhsNotRecord.txt new file mode 100644 index 0000000..f27dddd --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeLhsNotRecord.txt @@ -0,0 +1,6 @@ +Type error: error: Merge1ArgMustBeRecord + --> :1:0 + | +1 | merge True < x >.x + | ^^^^^^^^^^^^^^^^^^ Merge1ArgMustBeRecord + | diff --git a/dhall/tests/type-inference/failure/unit/MergeMissingHandler1.txt b/dhall/tests/type-inference/failure/unit/MergeMissingHandler1.txt new file mode 100644 index 0000000..af58d05 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeMissingHandler1.txt @@ -0,0 +1,6 @@ +Type error: error: MergeVariantMissingHandler + --> :1:0 + | +1 | merge {=} .x + | ^^^^^^^^^^^^^^^ MergeVariantMissingHandler + | diff --git a/dhall/tests/type-inference/failure/unit/MergeMissingHandler2.txt b/dhall/tests/type-inference/failure/unit/MergeMissingHandler2.txt new file mode 100644 index 0000000..49484df --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeMissingHandler2.txt @@ -0,0 +1,6 @@ +Type error: error: MergeVariantMissingHandler + --> :1:0 + | +1 | merge { x = 0 } .x + | ^^^^^^^^^^^^^^^^^^^^^^^^^ MergeVariantMissingHandler + | diff --git a/dhall/tests/type-inference/failure/unit/MergeRhsNotUnion.txt b/dhall/tests/type-inference/failure/unit/MergeRhsNotUnion.txt new file mode 100644 index 0000000..0108725 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeRhsNotUnion.txt @@ -0,0 +1,6 @@ +Type error: error: Merge2ArgMustBeUnionOrOptional + --> :1:0 + | +1 | merge {=} True + | ^^^^^^^^^^^^^^ Merge2ArgMustBeUnionOrOptional + | diff --git a/dhall/tests/type-inference/failure/unit/MergeUnusedHandler.txt b/dhall/tests/type-inference/failure/unit/MergeUnusedHandler.txt new file mode 100644 index 0000000..2afe376 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MergeUnusedHandler.txt @@ -0,0 +1,6 @@ +Type error: error: MergeHandlerMissingVariant + --> :1:0 + | +1 | merge { x = 1, y = 2 } < x >.x + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MergeHandlerMissingVariant + | diff --git a/dhall/tests/type-inference/failure/unit/MistypedToMap1.txt b/dhall/tests/type-inference/failure/unit/MistypedToMap1.txt new file mode 100644 index 0000000..14d9791 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MistypedToMap1.txt @@ -0,0 +1,6 @@ +Type error: error: Annotation mismatch + --> :1:0 + | +1 | toMap { foo= 1, bar= 4 } : Natural + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch + | diff --git a/dhall/tests/type-inference/failure/unit/MistypedToMap2.txt b/dhall/tests/type-inference/failure/unit/MistypedToMap2.txt new file mode 100644 index 0000000..88e303e --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MistypedToMap2.txt @@ -0,0 +1,6 @@ +Type error: error: Annotation mismatch + --> :1:0 + | +1 | toMap { foo= 1, bar= 4 } : List Natural + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch + | diff --git a/dhall/tests/type-inference/failure/unit/MistypedToMap3.txt b/dhall/tests/type-inference/failure/unit/MistypedToMap3.txt new file mode 100644 index 0000000..6b3772d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MistypedToMap3.txt @@ -0,0 +1,6 @@ +Type error: error: Annotation mismatch + --> :1:0 + | +1 | toMap { foo= 1, bar= 4 } : List { mapKey : Natural, mapValue : Natural } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch + | diff --git a/dhall/tests/type-inference/failure/unit/MistypedToMap4.txt b/dhall/tests/type-inference/failure/unit/MistypedToMap4.txt new file mode 100644 index 0000000..e0cf651 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/MistypedToMap4.txt @@ -0,0 +1,6 @@ +Type error: error: Annotation mismatch + --> :1:0 + | +1 | toMap { foo= 1, bar= 4 } : List { mapKey : Text, mapValue : Text } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch + | diff --git a/dhall/tests/type-inference/failure/unit/NaturalSubtractNotNatural.txt b/dhall/tests/type-inference/failure/unit/NaturalSubtractNotNatural.txt new file mode 100644 index 0000000..ac336a6 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/NaturalSubtractNotNatural.txt @@ -0,0 +1,9 @@ +Type error: error: wrong type of function argument + --> :1:0 + | +1 | Natural/subtract True True + | ^^^^^^^^^^^^^^^^ this expects an argument of type: Natural + | ^^^^ but this has type: Bool + | + = note: expected type `Natural` + found type `Bool` diff --git a/dhall/tests/type-inference/failure/unit/NonRecordToMap.txt b/dhall/tests/type-inference/failure/unit/NonRecordToMap.txt new file mode 100644 index 0000000..8e83002 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/NonRecordToMap.txt @@ -0,0 +1,6 @@ +Type error: error: The argument to `toMap` must be a record + --> :1:0 + | +1 | toMap "text" + | ^^^^^^^^^^^^ The argument to `toMap` must be a record + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorAndNotBool.txt b/dhall/tests/type-inference/failure/unit/OperatorAndNotBool.txt new file mode 100644 index 0000000..f6ea50b --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorAndNotBool.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 && 1 + | ^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorEqualNotBool.txt b/dhall/tests/type-inference/failure/unit/OperatorEqualNotBool.txt new file mode 100644 index 0000000..8662c16 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorEqualNotBool.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 == 1 + | ^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorListConcatenateLhsNotList.txt b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateLhsNotList.txt new file mode 100644 index 0000000..8075b99 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateLhsNotList.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 # [ True ] + | ^^^^^^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorListConcatenateListsNotMatch.txt b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateListsNotMatch.txt new file mode 100644 index 0000000..9e404f8 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateListsNotMatch.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | [ True ] # [ 1 ] + | ^^^^^^^^^^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorListConcatenateNotListsButMatch.txt b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateNotListsButMatch.txt new file mode 100644 index 0000000..fffc898 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateNotListsButMatch.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 # 2 + | ^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorListConcatenateRhsNotList.txt b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateRhsNotList.txt new file mode 100644 index 0000000..2ba0b91 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorListConcatenateRhsNotList.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | [ True ] # 1 + | ^^^^^^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorNotEqualNotBool.txt b/dhall/tests/type-inference/failure/unit/OperatorNotEqualNotBool.txt new file mode 100644 index 0000000..ac04fd4 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorNotEqualNotBool.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 != 1 + | ^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorOrNotBool.txt b/dhall/tests/type-inference/failure/unit/OperatorOrNotBool.txt new file mode 100644 index 0000000..9e1c4fb --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorOrNotBool.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 || 1 + | ^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorPlusNotNatural.txt b/dhall/tests/type-inference/failure/unit/OperatorPlusNotNatural.txt new file mode 100644 index 0000000..97e0df4 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorPlusNotNatural.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | True + True + | ^^^^^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateLhsNotText.txt b/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateLhsNotText.txt new file mode 100644 index 0000000..679d991 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateLhsNotText.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | 1 ++ "" + | ^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateRhsNotText.txt b/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateRhsNotText.txt new file mode 100644 index 0000000..85611f7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorTextConcatenateRhsNotText.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | "" ++ 1 + | ^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OperatorTimesNotNatural.txt b/dhall/tests/type-inference/failure/unit/OperatorTimesNotNatural.txt new file mode 100644 index 0000000..d688ed6 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OperatorTimesNotNatural.txt @@ -0,0 +1,6 @@ +Type error: error: BinOpTypeMismatch + --> :1:0 + | +1 | True * True + | ^^^^^^^^^^^ BinOpTypeMismatch + | diff --git a/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxAbsent.txt b/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxAbsent.txt new file mode 100644 index 0000000..bfb36ae --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxAbsent.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidListType + --> :1:0 + | +1 | [] : Optional Bool + | ^^^^^^^^^^^^^^^^^^ InvalidListType + | diff --git a/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxPresent.txt b/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxPresent.txt new file mode 100644 index 0000000..5332fcb --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/OptionalDeprecatedSyntaxPresent.txt @@ -0,0 +1,6 @@ +Type error: error: annot mismatch: ([1] : List Natural) : Optional Natural + --> :1:0 + | +1 | [ 1 ] : Optional Natural + | ^^^^^^^^^^^^^^^^^^^^^^^^ annot mismatch: ([1] : List Natural) : Optional Natural + | diff --git a/dhall/tests/type-inference/failure/unit/RecordLitDuplicateFields.txt b/dhall/tests/type-inference/failure/unit/RecordLitDuplicateFields.txt new file mode 100644 index 0000000..608c6a0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordLitDuplicateFields.txt @@ -0,0 +1,6 @@ +Type error: error: RecordTypeDuplicateField + --> :1:0 + | +1 | { x = 0, x = 0 } + | ^^^^^^^^^^^^^^^^ RecordTypeDuplicateField + | diff --git a/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeFieldTypeMismatch.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeFieldTypeMismatch.txt new file mode 100644 index 0000000..d624075 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeFieldTypeMismatch.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionWrongType + --> :1:0 + | +1 | { y = {=} }.( {y : Natural} ) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ProjectionWrongType + | diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeNotPresent.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeNotPresent.txt new file mode 100644 index 0000000..c22c2c4 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionByTypeNotPresent.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionMissingEntry + --> :1:0 + | +1 | { y = {=} }.( {x : Natural} ) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ProjectionMissingEntry + | diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionDuplicateFields.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionDuplicateFields.txt new file mode 100644 index 0000000..5c6520b --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionDuplicateFields.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionDuplicateField + --> :1:0 + | +1 | { x = 1 }.{ x, x } + | ^^^^^^^^^^^^^^^^^^ ProjectionDuplicateField + | diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionEmpty.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionEmpty.txt new file mode 100644 index 0000000..39f263b --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionEmpty.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionMissingEntry + --> :1:0 + | +1 | {=}.{ x } + | ^^^^^^^^^ ProjectionMissingEntry + | diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionNotPresent.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionNotPresent.txt new file mode 100644 index 0000000..032f7a0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionNotPresent.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionMissingEntry + --> :1:0 + | +1 | { y = {=} }.{ x } + | ^^^^^^^^^^^^^^^^^ ProjectionMissingEntry + | diff --git a/dhall/tests/type-inference/failure/unit/RecordProjectionNotRecord.txt b/dhall/tests/type-inference/failure/unit/RecordProjectionNotRecord.txt new file mode 100644 index 0000000..5ed6ffd --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordProjectionNotRecord.txt @@ -0,0 +1,6 @@ +Type error: error: ProjectionMustBeRecord + --> :1:0 + | +1 | True.{ x } + | ^^^^^^^^^^ ProjectionMustBeRecord + | diff --git a/dhall/tests/type-inference/failure/unit/RecordSelectionEmpty.txt b/dhall/tests/type-inference/failure/unit/RecordSelectionEmpty.txt new file mode 100644 index 0000000..5b3b7f8 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordSelectionEmpty.txt @@ -0,0 +1,6 @@ +Type error: error: MissingRecordField + --> :1:0 + | +1 | {=}.x + | ^^^^^ MissingRecordField + | diff --git a/dhall/tests/type-inference/failure/unit/RecordSelectionNotPresent.txt b/dhall/tests/type-inference/failure/unit/RecordSelectionNotPresent.txt new file mode 100644 index 0000000..d435ca0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordSelectionNotPresent.txt @@ -0,0 +1,6 @@ +Type error: error: MissingRecordField + --> :1:0 + | +1 | { y = {=} }.x + | ^^^^^^^^^^^^^ MissingRecordField + | diff --git a/dhall/tests/type-inference/failure/unit/RecordSelectionNotRecord.txt b/dhall/tests/type-inference/failure/unit/RecordSelectionNotRecord.txt new file mode 100644 index 0000000..3f9b7ed --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordSelectionNotRecord.txt @@ -0,0 +1,6 @@ +Type error: error: NotARecord + --> :1:0 + | +1 | True.x + | ^^^^^^ NotARecord + | diff --git a/dhall/tests/type-inference/failure/unit/RecordSelectionTypeNotUnionType.txt b/dhall/tests/type-inference/failure/unit/RecordSelectionTypeNotUnionType.txt new file mode 100644 index 0000000..cca28b8 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordSelectionTypeNotUnionType.txt @@ -0,0 +1,6 @@ +Type error: error: NotARecord + --> :1:0 + | +1 | Bool.x + | ^^^^^^ NotARecord + | diff --git a/dhall/tests/type-inference/failure/unit/RecordTypeDuplicateFields.txt b/dhall/tests/type-inference/failure/unit/RecordTypeDuplicateFields.txt new file mode 100644 index 0000000..145a59b --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordTypeDuplicateFields.txt @@ -0,0 +1,6 @@ +Type error: error: RecordTypeDuplicateField + --> :1:0 + | +1 | { x: Natural, x: Natural } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ RecordTypeDuplicateField + | diff --git a/dhall/tests/type-inference/failure/unit/RecordTypeValueMember.txt b/dhall/tests/type-inference/failure/unit/RecordTypeValueMember.txt new file mode 100644 index 0000000..04488ad --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecordTypeValueMember.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | { x : True } + | ^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeLhsNotRecord.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeLhsNotRecord.txt new file mode 100644 index 0000000..f74e839 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeLhsNotRecord.txt @@ -0,0 +1 @@ +Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeOverlapping.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeOverlapping.txt new file mode 100644 index 0000000..f74e839 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeOverlapping.txt @@ -0,0 +1 @@ +Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeRhsNotRecord.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeRhsNotRecord.txt new file mode 100644 index 0000000..f74e839 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordMergeRhsNotRecord.txt @@ -0,0 +1 @@ +Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt new file mode 100644 index 0000000..b35e64b --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt @@ -0,0 +1,6 @@ +Type error: error: RecordTypeMergeRequiresRecordType + --> :1:0 + | +1 | Bool ⩓ {} + | ^^^^^^^^^ RecordTypeMergeRequiresRecordType + | diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeOverlapping.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeOverlapping.txt new file mode 100644 index 0000000..f74e839 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeOverlapping.txt @@ -0,0 +1 @@ +Type error: error: RecordTypeMergeRequiresRecordType diff --git a/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt new file mode 100644 index 0000000..0200f97 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt @@ -0,0 +1,6 @@ +Type error: error: RecordTypeMergeRequiresRecordType + --> :1:0 + | +1 | {} ⩓ Bool + | ^^^^^^^^^ RecordTypeMergeRequiresRecordType + | diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeLhsNotRecord.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeLhsNotRecord.txt new file mode 100644 index 0000000..3b158ce --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeLhsNotRecord.txt @@ -0,0 +1,6 @@ +Type error: error: MustCombineRecord + --> :1:0 + | +1 | True ⫽ {=} + | ^^^^^^^^^^ MustCombineRecord + | diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeRhsNotRecord.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeRhsNotRecord.txt new file mode 100644 index 0000000..4f9cb0d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeRhsNotRecord.txt @@ -0,0 +1,6 @@ +Type error: error: MustCombineRecord + --> :1:0 + | +1 | {=} ⫽ True + | ^^^^^^^^^^ MustCombineRecord + | diff --git a/dhall/tests/type-inference/failure/unit/SomeNotType.txt b/dhall/tests/type-inference/failure/unit/SomeNotType.txt new file mode 100644 index 0000000..3584768 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/SomeNotType.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidOptionalType + --> :1:0 + | +1 | Some Bool + | ^^^^^^^^^ InvalidOptionalType + | diff --git a/dhall/tests/type-inference/failure/unit/Sort.txt b/dhall/tests/type-inference/failure/unit/Sort.txt new file mode 100644 index 0000000..5b88ff7 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/Sort.txt @@ -0,0 +1 @@ +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-inference/failure/unit/TextLiteralInterpolateNotText.txt b/dhall/tests/type-inference/failure/unit/TextLiteralInterpolateNotText.txt new file mode 100644 index 0000000..0132a30 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/TextLiteralInterpolateNotText.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidTextInterpolation + --> :1:0 + | +1 | "${1}" + | ^^^^^^ InvalidTextInterpolation + | diff --git a/dhall/tests/type-inference/failure/unit/ToMapEmptyInvalidAnnotation.txt b/dhall/tests/type-inference/failure/unit/ToMapEmptyInvalidAnnotation.txt new file mode 100644 index 0000000..c28073e --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/ToMapEmptyInvalidAnnotation.txt @@ -0,0 +1,7 @@ +Type error: error: The type of `toMap x` must be of the form `List { mapKey : Text, mapValue : T }` + --> :2:0 + | +1 | -- The mapKey must be Text +2 | toMap {=} : List { mapKey : Bool, mapValue : Text } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type of `toMap x` must be of the form `List { mapKey : Text, mapValue : T }` + | diff --git a/dhall/tests/type-inference/failure/unit/ToMapWrongKind.txt b/dhall/tests/type-inference/failure/unit/ToMapWrongKind.txt new file mode 100644 index 0000000..8158c08 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/ToMapWrongKind.txt @@ -0,0 +1,6 @@ +Type error: error: `toMap` only accepts records of type `Type` + --> :1:0 + | +1 | toMap { x = Bool } + | ^^^^^^^^^^^^^^^^^^ `toMap` only accepts records of type `Type` + | diff --git a/dhall/tests/type-inference/failure/unit/TypeAnnotationWrong.txt b/dhall/tests/type-inference/failure/unit/TypeAnnotationWrong.txt new file mode 100644 index 0000000..7360e68 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/TypeAnnotationWrong.txt @@ -0,0 +1,6 @@ +Type error: error: annot mismatch: (1 : Natural) : Bool + --> :1:0 + | +1 | 1 : Bool + | ^^^^^^^^ annot mismatch: (1 : Natural) : Bool + | diff --git a/dhall/tests/type-inference/failure/unit/UnionConstructorFieldNotPresent.txt b/dhall/tests/type-inference/failure/unit/UnionConstructorFieldNotPresent.txt new file mode 100644 index 0000000..41d283d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionConstructorFieldNotPresent.txt @@ -0,0 +1,6 @@ +Type error: error: MissingUnionField + --> :1:0 + | +1 | < x : Bool >.y + | ^^^^^^^^^^^^^^ MissingUnionField + | diff --git a/dhall/tests/type-inference/failure/unit/UnionDeprecatedConstructorsKeyword.txt b/dhall/tests/type-inference/failure/unit/UnionDeprecatedConstructorsKeyword.txt new file mode 100644 index 0000000..91fb96d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionDeprecatedConstructorsKeyword.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable `constructors` + --> :1:0 + | +1 | constructors < Left : Natural | Right : Bool > + | ^^^^^^^^^^^^ not found in this scope + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants1.txt b/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants1.txt new file mode 100644 index 0000000..7372641 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants1.txt @@ -0,0 +1,6 @@ +Type error: error: UnionTypeDuplicateField + --> :1:0 + | +1 | + | ^^^^^^^ UnionTypeDuplicateField + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants2.txt b/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants2.txt new file mode 100644 index 0000000..07042c2 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeDuplicateVariants2.txt @@ -0,0 +1,6 @@ +Type error: error: UnionTypeDuplicateField + --> :1:0 + | +1 | + | ^^^^^^^^^^^^^^^^ UnionTypeDuplicateField + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt new file mode 100644 index 0000000..00e24b3 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | < x : Bool | y : Type > + | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt new file mode 100644 index 0000000..924b1e1 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | < x : Kind | y : Type > + | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt new file mode 100644 index 0000000..1113a0d --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | < x : Kind | y : Bool > + | ^^^^^^^^^^^^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeNotType.txt b/dhall/tests/type-inference/failure/unit/UnionTypeNotType.txt new file mode 100644 index 0000000..b2c06e0 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/UnionTypeNotType.txt @@ -0,0 +1,6 @@ +Type error: error: InvalidFieldType + --> :1:0 + | +1 | < x : True > + | ^^^^^^^^^^^^ InvalidFieldType + | diff --git a/dhall/tests/type-inference/failure/unit/VariableFree.txt b/dhall/tests/type-inference/failure/unit/VariableFree.txt new file mode 100644 index 0000000..db78e15 --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/VariableFree.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable `x` + --> :1:0 + | +1 | x + | ^ not found in this scope + | -- cgit v1.2.3 From 5d0f37d89f23512c2676b1f2d0235f25269c53ab Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 18:29:13 +0000 Subject: Add option to overwrite test files --- README.md | 31 +++++++++++ dhall/src/tests.rs | 153 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 136 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 2c6c5c7..aa5cc61 100644 --- a/README.md +++ b/README.md @@ -124,8 +124,39 @@ $ cargo build $ cargo test ``` +You can also run tests individually by their name: + +```bash +$ cargo test tests::spec::name_of_test +``` + Now we can have fun and happy contributing! +## Test suite + +The test suite uses tests from the dhall-lang submodule as well as from the +local `dhall/tests` directory. +The various tests are run according to the instructions present in +[`dhall-lang/tests/README.md`](https://github.com/dhall-lang/dhall-lang/blob/master/tests/README.md). + +If an output test file (a `fooB.dhall` file) is missing, we will generate it automatically. +This is useful when writing new tests. Don't forget to commit it to git ! + +If a test fails but you prefer the new output, you can run the test with +`UPDATE_TEST_FILES=1` to overwrite the result file with the new output. +This happens often with ui tests (see below), since we may want to change the +phrasing of errors for example. + +```bash +$ UPDATE_TEST_FILES=1 cargo test tests::spec::name_of_test +``` + +In addition to the usual dhall tests, we additionally run "ui tests", that +ensure that the output of the various errors stays good. +The output of the ui tests is stored in the local `dhall/tests` directory, even +for the tests coming from dhall-lang. They are stored in a `.txt` file with the +same name as the corresponding test. + ## Changelog - 0.2.1: Improve documentation and deserialize many more types diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index d8ce2fa..366ba32 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -43,7 +43,8 @@ macro_rules! assert_eq_pretty_str { }; } -use std::fs::File; +use std::env; +use std::fs::{create_dir_all, read_to_string, File}; use std::io::{Read, Write}; use std::path::PathBuf; @@ -102,18 +103,74 @@ impl TestFile { Ok(self.resolve()?.typecheck()?.normalize()) } + /// If UPDATE_TEST_FILES=1, we overwrite the output files with our own output. + fn force_update() -> bool { + env::var("UPDATE_TEST_FILES") == Ok("1".to_string()) + } + /// Write the provided expression to the pointed file. + fn write_expr(&self, expr: impl Into) -> Result<()> { + let expr = expr.into(); + let path = self.path(); + create_dir_all(path.parent().unwrap())?; + let mut file = File::create(path)?; + match self { + TestFile::Source(_) => { + writeln!(file, "{}", expr)?; + } + TestFile::Binary(_) => { + let expr_data = binary::encode(&expr)?; + file.write_all(&expr_data)?; + } + TestFile::UI(_) => panic!("Can't write an expression to a UI file"), + } + Ok(()) + } + /// Write the provided error to the pointed file. + fn write_ui(&self, err: impl Into) -> Result<()> { + match self { + TestFile::UI(_) => {} + _ => panic!("Can't write an error to a non-UI file"), + } + let err = err.into(); + let path = self.path(); + create_dir_all(path.parent().unwrap())?; + let mut file = File::create(path)?; + writeln!(file, "{}", err)?; + Ok(()) + } + /// Check that the provided expression matches the file contents. pub fn compare(&self, expr: impl Into) -> Result<()> { let expr = expr.into(); + if !self.path().is_file() { + return self.write_expr(expr); + } + let expected = self.parse()?.to_expr(); - assert_eq_display!(expr, expected); + if expr != expected { + if Self::force_update() { + self.write_expr(expr)?; + } else { + assert_eq_display!(expr, expected); + } + } Ok(()) } /// Check that the provided expression matches the file contents. pub fn compare_debug(&self, expr: impl Into) -> Result<()> { let expr = expr.into(); + if !self.path().is_file() { + return self.write_expr(expr); + } + let expected = self.parse()?.to_expr(); - assert_eq_pretty!(expr, expected); + if expr != expected { + if Self::force_update() { + self.write_expr(expr)?; + } else { + assert_eq_pretty!(expr, expected); + } + } Ok(()) } /// Check that the provided expression matches the file contents. @@ -121,11 +178,16 @@ impl TestFile { &self, expr: impl Into, ) -> Result<()> { + let expr = expr.into(); match self { TestFile::Binary(_) => {} _ => panic!("This is not a binary file"), } - let expr_data = binary::encode(&expr.into())?; + if !self.path().is_file() { + return self.write_expr(expr); + } + + let expr_data = binary::encode(&expr)?; let expected_data = { let mut data = Vec::new(); File::open(&self.path())?.read_to_end(&mut data)?; @@ -134,17 +196,38 @@ impl TestFile { // Compare bit-by-bit if expr_data != expected_data { - use serde_cbor::de::from_slice; - use serde_cbor::value::Value; - // use std::io::Write; - // File::create(&expected)?.write_all(&expr_data)?; - // Pretty-print difference - assert_eq_pretty!( - from_slice::(&expr_data).unwrap(), - from_slice::(&expected_data).unwrap() - ); - // If difference was not visible in the cbor::Value, compare normally. - assert_eq!(expr_data, expected_data); + if Self::force_update() { + self.write_expr(expr)?; + } else { + use serde_cbor::de::from_slice; + use serde_cbor::value::Value; + // Pretty-print difference + assert_eq_pretty!( + from_slice::(&expr_data).unwrap(), + from_slice::(&expected_data).unwrap() + ); + // If difference was not visible in the cbor::Value, compare normally. + assert_eq!(expr_data, expected_data); + } + } + Ok(()) + } + /// Check that the provided error matches the file contents. Writes to the corresponding file + /// if it is missing. + pub fn compare_ui(&self, err: impl Into) -> Result<()> { + let err = err.into(); + if !self.path().is_file() { + return self.write_ui(err); + } + + let expected = read_to_string(self.path())?; + let msg = format!("{}\n", err); + if msg != expected { + if Self::force_update() { + self.write_ui(err)?; + } else { + assert_eq_pretty_str!(msg, expected); + } } Ok(()) } @@ -165,11 +248,11 @@ fn run_test(test: Test) -> Result<()> { expected.compare_debug(expr)?; } ParserFailure(expr) => { + use std::io::ErrorKind; let err = expr.parse().unwrap_err(); match &err { Error::Parse(_) => {} - Error::IO(e) if e.kind() == std::io::ErrorKind::InvalidData => { - } + Error::IO(e) if e.kind() == ErrorKind::InvalidData => {} e => panic!("Expected parse error, got: {:?}", e), } } @@ -187,7 +270,7 @@ fn run_test(test: Test) -> Result<()> { Printer(expr, _) => { let expected = expr.parse()?; // Round-trip pretty-printer - let expr: Parsed = Parsed::parse_str(&expected.to_string())?; + let expr = Parsed::parse_str(&expected.to_string())?; assert_eq!(expr, expected); } ImportSuccess(expr, expected) => { @@ -197,22 +280,9 @@ fn run_test(test: Test) -> Result<()> { ImportFailure(expr) => { expr.parse()?.resolve().unwrap_err(); } - // Checks the output of the type error against a text file. If the text file doesn't exist, - // we instead write to it the output we got. This makes it easy to update those files: just - // `rm -r dhall/tests/type-errors` and run the tests again. ImportError(expr, expected) => { - let err: Error = expr.parse()?.resolve().unwrap_err().into(); - - let error_file_path = expected.path(); - if error_file_path.is_file() { - let expected_msg = std::fs::read_to_string(error_file_path)?; - let msg = format!("{}\n", err); - assert_eq_pretty_str!(msg, expected_msg); - } else { - std::fs::create_dir_all(error_file_path.parent().unwrap())?; - let mut file = File::create(error_file_path)?; - writeln!(file, "{}", err)?; - } + let err = expr.parse()?.resolve().unwrap_err(); + expected.compare_ui(err)?; } TypeInferenceSuccess(expr, expected) => { let ty = expr.resolve()?.typecheck()?.get_type()?; @@ -221,22 +291,9 @@ fn run_test(test: Test) -> Result<()> { TypeInferenceFailure(expr) => { expr.resolve()?.typecheck().unwrap_err(); } - // Checks the output of the type error against a text file. If the text file doesn't exist, - // we instead write to it the output we got. This makes it easy to update those files: just - // `rm -r dhall/tests/type-errors` and run the tests again. TypeError(expr, expected) => { - let err: Error = expr.resolve()?.typecheck().unwrap_err().into(); - - let error_file_path = expected.path(); - if error_file_path.is_file() { - let expected_msg = std::fs::read_to_string(error_file_path)?; - let msg = format!("{}\n", err); - assert_eq_pretty_str!(msg, expected_msg); - } else { - std::fs::create_dir_all(error_file_path.parent().unwrap())?; - let mut file = File::create(error_file_path)?; - writeln!(file, "{}", err)?; - } + let err = expr.resolve()?.typecheck().unwrap_err(); + expected.compare_ui(err)?; } Normalization(expr, expected) => { let expr = expr.normalize()?; -- cgit v1.2.3 From 02cacfd0360a0acea959c5a9b6d1b7fb0241db81 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 18:35:16 +0000 Subject: Remove distinction between failure and error tests --- dhall/build.rs | 28 ---------------------------- dhall/src/tests.rs | 16 ++++------------ 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)?; } -- cgit v1.2.3 From 4c2a28b844b18d7b67278a1c8f628d9a95ea37c4 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 9 Feb 2020 18:40:15 +0000 Subject: Track error output of parsing and binary decoding tests --- dhall/build.rs | 4 ++-- dhall/src/tests.rs | 12 +++++++----- dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt | 1 + .../failure/unit/LambdaExplicitlyNamedUnderscore.txt | 1 + .../binary-decode/failure/unit/ListOneWithAnnotation.txt | 1 + .../tests/binary-decode/failure/unit/NaturalNegativeOne.txt | 1 + .../binary-decode/failure/unit/OperatorOrTooFewArgs.txt | 1 + .../binary-decode/failure/unit/OperatorOrTooManyArgs.txt | 1 + .../binary-decode/failure/unit/OperatorUnknownOpcode.txt | 1 + .../failure/unit/PiExplicitlyNamedUnderscore.txt | 1 + .../failure/unit/VariableExplicitlyNamedUnderscore.txt | 1 + dhall/tests/parser/failure/ImportHeadersExteriorHash.txt | 6 ++++++ dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt | 6 ++++++ dhall/tests/parser/failure/annotation.txt | 6 ++++++ dhall/tests/parser/failure/boundBuiltins.txt | 6 ++++++ dhall/tests/parser/failure/builtinWithIndex.txt | 6 ++++++ dhall/tests/parser/failure/doubleBoundsNeg.txt | 6 ++++++ dhall/tests/parser/failure/doubleBoundsPos.txt | 6 ++++++ dhall/tests/parser/failure/fSomeX.txt | 6 ++++++ dhall/tests/parser/failure/importAccess.txt | 6 ++++++ dhall/tests/parser/failure/incompleteIf.txt | 6 ++++++ dhall/tests/parser/failure/mandatoryNewline.txt | 6 ++++++ dhall/tests/parser/failure/nonBase16Hash.txt | 6 ++++++ dhall/tests/parser/failure/nonCharacter.txt | 6 ++++++ dhall/tests/parser/failure/nonCharacterUnbraced.txt | 6 ++++++ dhall/tests/parser/failure/nonUtf8.txt | 1 + dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt | 6 ++++++ dhall/tests/parser/failure/spacing/AssertNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ForallNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/HeadersNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/IfNoSpace1.txt | 6 ++++++ dhall/tests/parser/failure/spacing/IfNoSpace2.txt | 6 ++++++ dhall/tests/parser/failure/spacing/IfNoSpace3.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/LambdaNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/LetNoSpace1.txt | 6 ++++++ dhall/tests/parser/failure/spacing/LetNoSpace2.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt | 6 ++++++ .../tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt | 6 ++++++ dhall/tests/parser/failure/spacing/MergeNoSpace1.txt | 6 ++++++ dhall/tests/parser/failure/spacing/MergeNoSpace2.txt | 6 ++++++ dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/SomeNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/ToMapNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt | 6 ++++++ dhall/tests/parser/failure/surrogatePairUnbraced.txt | 6 ++++++ dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt | 6 ++++++ dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt | 6 ++++++ dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt | 6 ++++++ dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt | 6 ++++++ dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt | 6 ++++++ .../parser/failure/unit/ListLitEmptyMissingAnnotation.txt | 6 ++++++ dhall/tests/parser/failure/unit/MergeAlone.txt | 6 ++++++ dhall/tests/parser/failure/unit/MergeOneArgument.txt | 6 ++++++ dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt | 6 ++++++ dhall/tests/parser/failure/unit/SomeAlone.txt | 6 ++++++ 63 files changed, 325 insertions(+), 7 deletions(-) create mode 100644 dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt create mode 100644 dhall/tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore.txt create mode 100644 dhall/tests/binary-decode/failure/unit/ListOneWithAnnotation.txt create mode 100644 dhall/tests/binary-decode/failure/unit/NaturalNegativeOne.txt create mode 100644 dhall/tests/binary-decode/failure/unit/OperatorOrTooFewArgs.txt create mode 100644 dhall/tests/binary-decode/failure/unit/OperatorOrTooManyArgs.txt create mode 100644 dhall/tests/binary-decode/failure/unit/OperatorUnknownOpcode.txt create mode 100644 dhall/tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore.txt create mode 100644 dhall/tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore.txt create mode 100644 dhall/tests/parser/failure/ImportHeadersExteriorHash.txt create mode 100644 dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt create mode 100644 dhall/tests/parser/failure/annotation.txt create mode 100644 dhall/tests/parser/failure/boundBuiltins.txt create mode 100644 dhall/tests/parser/failure/builtinWithIndex.txt create mode 100644 dhall/tests/parser/failure/doubleBoundsNeg.txt create mode 100644 dhall/tests/parser/failure/doubleBoundsPos.txt create mode 100644 dhall/tests/parser/failure/fSomeX.txt create mode 100644 dhall/tests/parser/failure/importAccess.txt create mode 100644 dhall/tests/parser/failure/incompleteIf.txt create mode 100644 dhall/tests/parser/failure/mandatoryNewline.txt create mode 100644 dhall/tests/parser/failure/nonBase16Hash.txt create mode 100644 dhall/tests/parser/failure/nonCharacter.txt create mode 100644 dhall/tests/parser/failure/nonCharacterUnbraced.txt create mode 100644 dhall/tests/parser/failure/nonUtf8.txt create mode 100644 dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt create mode 100644 dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt create mode 100644 dhall/tests/parser/failure/spacing/AssertNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/ForallNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/HeadersNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/IfNoSpace1.txt create mode 100644 dhall/tests/parser/failure/spacing/IfNoSpace2.txt create mode 100644 dhall/tests/parser/failure/spacing/IfNoSpace3.txt create mode 100644 dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/LambdaNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/LetNoSpace1.txt create mode 100644 dhall/tests/parser/failure/spacing/LetNoSpace2.txt create mode 100644 dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt create mode 100644 dhall/tests/parser/failure/spacing/MergeNoSpace1.txt create mode 100644 dhall/tests/parser/failure/spacing/MergeNoSpace2.txt create mode 100644 dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/SomeNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/ToMapNoSpace.txt create mode 100644 dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt create mode 100644 dhall/tests/parser/failure/surrogatePairUnbraced.txt create mode 100644 dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt create mode 100644 dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt create mode 100644 dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt create mode 100644 dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt create mode 100644 dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt create mode 100644 dhall/tests/parser/failure/unit/ListLitEmptyMissingAnnotation.txt create mode 100644 dhall/tests/parser/failure/unit/MergeAlone.txt create mode 100644 dhall/tests/parser/failure/unit/MergeOneArgument.txt create mode 100644 dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt create mode 100644 dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt create mode 100644 dhall/tests/parser/failure/unit/SomeAlone.txt diff --git a/dhall/build.rs b/dhall/build.rs index 552966b..8deb637 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -172,7 +172,7 @@ fn generate_tests() -> std::io::Result<()> { variant: "ParserFailure", path_filter: Box::new(|_path: &str| false), input_type: FileType::Text, - output_type: None, + output_type: Some(FileType::UI), }, TestFeature { module_name: "printer", @@ -232,7 +232,7 @@ fn generate_tests() -> std::io::Result<()> { variant: "BinaryDecodingFailure", path_filter: Box::new(|_path: &str| false), input_type: FileType::Binary, - output_type: None, + output_type: Some(FileType::UI), }, TestFeature { module_name: "import_success", diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 19e5264..6a67ddc 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -55,11 +55,11 @@ use crate::{Normalized, NormalizedExpr, Parsed, Resolved}; #[allow(dead_code)] enum Test { ParserSuccess(TestFile, TestFile), - ParserFailure(TestFile), + ParserFailure(TestFile, TestFile), Printer(TestFile, TestFile), BinaryEncoding(TestFile, TestFile), BinaryDecodingSuccess(TestFile, TestFile), - BinaryDecodingFailure(TestFile), + BinaryDecodingFailure(TestFile, TestFile), ImportSuccess(TestFile, TestFile), ImportFailure(TestFile, TestFile), TypeInferenceSuccess(TestFile, TestFile), @@ -245,7 +245,7 @@ fn run_test(test: Test) -> Result<()> { // This exercices both parsing and binary decoding expected.compare_debug(expr)?; } - ParserFailure(expr) => { + ParserFailure(expr, expected) => { use std::io::ErrorKind; let err = expr.parse().unwrap_err(); match &err { @@ -253,6 +253,7 @@ fn run_test(test: Test) -> Result<()> { Error::IO(e) if e.kind() == ErrorKind::InvalidData => {} e => panic!("Expected parse error, got: {:?}", e), } + expected.compare_ui(err)?; } BinaryEncoding(expr, expected) => { let expr = expr.parse()?; @@ -262,8 +263,9 @@ fn run_test(test: Test) -> Result<()> { let expr = expr.parse()?; expected.compare_debug(expr)?; } - BinaryDecodingFailure(expr) => { - expr.parse().unwrap_err(); + BinaryDecodingFailure(expr, expected) => { + let err = expr.parse().unwrap_err(); + expected.compare_ui(err)?; } Printer(expr, _) => { let expected = expr.parse()?; diff --git a/dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt b/dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt new file mode 100644 index 0000000..0d8b602 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt @@ -0,0 +1 @@ +WrongFormatError("Function application must have at least one argument") diff --git a/dhall/tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore.txt b/dhall/tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore.txt new file mode 100644 index 0000000..a435173 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore.txt @@ -0,0 +1 @@ +WrongFormatError("`_` variable was encoded incorrectly") diff --git a/dhall/tests/binary-decode/failure/unit/ListOneWithAnnotation.txt b/dhall/tests/binary-decode/failure/unit/ListOneWithAnnotation.txt new file mode 100644 index 0000000..f96087c --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/ListOneWithAnnotation.txt @@ -0,0 +1 @@ +WrongFormatError("Array([U64(4), U64(0), U64(0)])") diff --git a/dhall/tests/binary-decode/failure/unit/NaturalNegativeOne.txt b/dhall/tests/binary-decode/failure/unit/NaturalNegativeOne.txt new file mode 100644 index 0000000..a09c213 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/NaturalNegativeOne.txt @@ -0,0 +1 @@ +WrongFormatError("Array([U64(15), I64(-1)])") diff --git a/dhall/tests/binary-decode/failure/unit/OperatorOrTooFewArgs.txt b/dhall/tests/binary-decode/failure/unit/OperatorOrTooFewArgs.txt new file mode 100644 index 0000000..8a7f8d6 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/OperatorOrTooFewArgs.txt @@ -0,0 +1 @@ +WrongFormatError("Array([U64(3), U64(0), U64(0)])") diff --git a/dhall/tests/binary-decode/failure/unit/OperatorOrTooManyArgs.txt b/dhall/tests/binary-decode/failure/unit/OperatorOrTooManyArgs.txt new file mode 100644 index 0000000..6d1bb39 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/OperatorOrTooManyArgs.txt @@ -0,0 +1 @@ +WrongFormatError("Array([U64(3), U64(0), U64(0), U64(0), U64(0)])") diff --git a/dhall/tests/binary-decode/failure/unit/OperatorUnknownOpcode.txt b/dhall/tests/binary-decode/failure/unit/OperatorUnknownOpcode.txt new file mode 100644 index 0000000..d61f0b0 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/OperatorUnknownOpcode.txt @@ -0,0 +1 @@ +WrongFormatError("binop") diff --git a/dhall/tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore.txt b/dhall/tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore.txt new file mode 100644 index 0000000..a435173 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore.txt @@ -0,0 +1 @@ +WrongFormatError("`_` variable was encoded incorrectly") diff --git a/dhall/tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore.txt b/dhall/tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore.txt new file mode 100644 index 0000000..a435173 --- /dev/null +++ b/dhall/tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore.txt @@ -0,0 +1 @@ +WrongFormatError("`_` variable was encoded incorrectly") diff --git a/dhall/tests/parser/failure/ImportHeadersExteriorHash.txt b/dhall/tests/parser/failure/ImportHeadersExteriorHash.txt new file mode 100644 index 0000000..1567dc1 --- /dev/null +++ b/dhall/tests/parser/failure/ImportHeadersExteriorHash.txt @@ -0,0 +1,6 @@ + --> 1:49 + | +1 | (https://example.com/foo using ./headers) sha256:0000000000000000000000000000000000000000000000000000000000000000␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt b/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt new file mode 100644 index 0000000..0586abb --- /dev/null +++ b/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | r.{ x: T }␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/annotation.txt b/dhall/tests/parser/failure/annotation.txt new file mode 100644 index 0000000..3390d3e --- /dev/null +++ b/dhall/tests/parser/failure/annotation.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | let a:Natural = 1 in a␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/boundBuiltins.txt b/dhall/tests/parser/failure/boundBuiltins.txt new file mode 100644 index 0000000..cd54e68 --- /dev/null +++ b/dhall/tests/parser/failure/boundBuiltins.txt @@ -0,0 +1,6 @@ + --> 6:5 + | +6 | let Bool : Natural = 1 in Bool␊ + | ^--- + | + = unexpected builtin diff --git a/dhall/tests/parser/failure/builtinWithIndex.txt b/dhall/tests/parser/failure/builtinWithIndex.txt new file mode 100644 index 0000000..b464038 --- /dev/null +++ b/dhall/tests/parser/failure/builtinWithIndex.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | Bool@2␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/doubleBoundsNeg.txt b/dhall/tests/parser/failure/doubleBoundsNeg.txt new file mode 100644 index 0000000..e90ae72 --- /dev/null +++ b/dhall/tests/parser/failure/doubleBoundsNeg.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | -179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.0␊ + | ^----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ + | + = Overflow while parsing double literal '-179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.0' diff --git a/dhall/tests/parser/failure/doubleBoundsPos.txt b/dhall/tests/parser/failure/doubleBoundsPos.txt new file mode 100644 index 0000000..7061be4 --- /dev/null +++ b/dhall/tests/parser/failure/doubleBoundsPos.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | 179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.0␊ + | ^---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ + | + = Overflow while parsing double literal '179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.0' diff --git a/dhall/tests/parser/failure/fSomeX.txt b/dhall/tests/parser/failure/fSomeX.txt new file mode 100644 index 0000000..a282410 --- /dev/null +++ b/dhall/tests/parser/failure/fSomeX.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | f Some x␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/importAccess.txt b/dhall/tests/parser/failure/importAccess.txt new file mode 100644 index 0000000..fa82c08 --- /dev/null +++ b/dhall/tests/parser/failure/importAccess.txt @@ -0,0 +1,6 @@ + --> 1:15 + | +1 | ./testImport .hello␊ + | ^--- + | + = expected path diff --git a/dhall/tests/parser/failure/incompleteIf.txt b/dhall/tests/parser/failure/incompleteIf.txt new file mode 100644 index 0000000..932b5d7 --- /dev/null +++ b/dhall/tests/parser/failure/incompleteIf.txt @@ -0,0 +1,6 @@ + --> 11:1 + | +11 | + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/mandatoryNewline.txt b/dhall/tests/parser/failure/mandatoryNewline.txt new file mode 100644 index 0000000..f7d41cd --- /dev/null +++ b/dhall/tests/parser/failure/mandatoryNewline.txt @@ -0,0 +1,6 @@ + --> 2:1 + | +2 | ''ABC''␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/nonBase16Hash.txt b/dhall/tests/parser/failure/nonBase16Hash.txt new file mode 100644 index 0000000..2a3fb26 --- /dev/null +++ b/dhall/tests/parser/failure/nonBase16Hash.txt @@ -0,0 +1,6 @@ + --> 1:13 + | +1 | ./foo sha256:d60d8415e36e86dae7f42933d3b0c4fe3ca238f057fba206c7e9fbf5d784fe1g␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/nonCharacter.txt b/dhall/tests/parser/failure/nonCharacter.txt new file mode 100644 index 0000000..9dfe19b --- /dev/null +++ b/dhall/tests/parser/failure/nonCharacter.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | "\u{10FFFF}"␊ + | ^-------^ + | + = Escape sequences can't contain non-characters diff --git a/dhall/tests/parser/failure/nonCharacterUnbraced.txt b/dhall/tests/parser/failure/nonCharacterUnbraced.txt new file mode 100644 index 0000000..2a5e2d7 --- /dev/null +++ b/dhall/tests/parser/failure/nonCharacterUnbraced.txt @@ -0,0 +1,6 @@ + --> 6:3 + | +6 | "\uFFFE"␊ + | ^---^ + | + = Escape sequences can't contain non-characters diff --git a/dhall/tests/parser/failure/nonUtf8.txt b/dhall/tests/parser/failure/nonUtf8.txt new file mode 100644 index 0000000..24c20d5 --- /dev/null +++ b/dhall/tests/parser/failure/nonUtf8.txt @@ -0,0 +1 @@ +stream did not contain valid UTF-8 diff --git a/dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt b/dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt new file mode 100644 index 0000000..a62db95 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | x :T␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt b/dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt new file mode 100644 index 0000000..1ca2115 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt @@ -0,0 +1,6 @@ + --> 1:2 + | +1 | f(x)␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt b/dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt new file mode 100644 index 0000000..f125801 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt @@ -0,0 +1,6 @@ + --> 2:16 + | +2 | ./example.dhall[1]␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/spacing/AssertNoSpace.txt b/dhall/tests/parser/failure/spacing/AssertNoSpace.txt new file mode 100644 index 0000000..0e83988 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/AssertNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:8 + | +1 | assert :T␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ForallNoSpace.txt b/dhall/tests/parser/failure/spacing/ForallNoSpace.txt new file mode 100644 index 0000000..697d400 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ForallNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:8 + | +1 | forall(x :T) -> x␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/spacing/HeadersNoSpace.txt b/dhall/tests/parser/failure/spacing/HeadersNoSpace.txt new file mode 100644 index 0000000..70ee479 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/HeadersNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:25 + | +1 | https://example.com/foo using(x)␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, hash, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/IfNoSpace1.txt b/dhall/tests/parser/failure/spacing/IfNoSpace1.txt new file mode 100644 index 0000000..d96ea58 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/IfNoSpace1.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | if(b) then x else y␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/spacing/IfNoSpace2.txt b/dhall/tests/parser/failure/spacing/IfNoSpace2.txt new file mode 100644 index 0000000..ee48b9b --- /dev/null +++ b/dhall/tests/parser/failure/spacing/IfNoSpace2.txt @@ -0,0 +1,6 @@ + --> 1:6 + | +1 | if b then(x) else y␊ + | ^--- + | + = expected import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/IfNoSpace3.txt b/dhall/tests/parser/failure/spacing/IfNoSpace3.txt new file mode 100644 index 0000000..6bc9d4b --- /dev/null +++ b/dhall/tests/parser/failure/spacing/IfNoSpace3.txt @@ -0,0 +1,6 @@ + --> 1:13 + | +1 | if b then x else(y)␊ + | ^--- + | + = expected import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt b/dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt new file mode 100644 index 0000000..ec7fb2e --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | x ?y␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt b/dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt new file mode 100644 index 0000000..0a13bd4 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:14 + | +1 | missingsha256:0000000000000000000000000000000000000000000000000000000000000000␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt b/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt new file mode 100644 index 0000000..adb0f1f --- /dev/null +++ b/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | \(x :T) -> x␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt b/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt new file mode 100644 index 0000000..577f157 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | let x :T = y in e␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/spacing/LetNoSpace1.txt b/dhall/tests/parser/failure/spacing/LetNoSpace1.txt new file mode 100644 index 0000000..24bbe63 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/LetNoSpace1.txt @@ -0,0 +1,6 @@ + --> 1:6 + | +1 | letx = y in e␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/LetNoSpace2.txt b/dhall/tests/parser/failure/spacing/LetNoSpace2.txt new file mode 100644 index 0000000..9355df4 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/LetNoSpace2.txt @@ -0,0 +1,6 @@ + --> 1:11 + | +1 | let x = y in(e)␊ + | ^--- + | + = expected import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, let_binding, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt b/dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt new file mode 100644 index 0000000..09b7dcd --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:2 + | +1 | [] :T␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt b/dhall/tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt new file mode 100644 index 0000000..612f4b3 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt @@ -0,0 +1,6 @@ + --> 1:11 + | +1 | merge x y :T␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/MergeNoSpace1.txt b/dhall/tests/parser/failure/spacing/MergeNoSpace1.txt new file mode 100644 index 0000000..f0974f8 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/MergeNoSpace1.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | merge(x) y␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt b/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt new file mode 100644 index 0000000..96d937b --- /dev/null +++ b/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt @@ -0,0 +1,6 @@ + --> 1:7 + | +1 | merge x(y)␊ + | ^--- + | + = expected missing, double_quote_literal, single_quote_literal, if_, merge, non_empty_list_literal, NaN, Some_, toMap, assert, forall, numeric_double_literal, minus_infinity_literal, plus_infinity_literal, natural_literal, integer_literal, or import_hashed diff --git a/dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt b/dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt new file mode 100644 index 0000000..0473531 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:4 + | +1 | x +y␊ + | ^--- + | + = expected natural_literal diff --git a/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt new file mode 100644 index 0000000..beca670 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | { x :T }␊ + | ^--- + | + = expected non_empty_record_literal or non_empty_record_type diff --git a/dhall/tests/parser/failure/spacing/SomeNoSpace.txt b/dhall/tests/parser/failure/spacing/SomeNoSpace.txt new file mode 100644 index 0000000..f488c9d --- /dev/null +++ b/dhall/tests/parser/failure/spacing/SomeNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | Some(x)␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt b/dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt new file mode 100644 index 0000000..b371dc4 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:9 + | +1 | toMap x :T␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/spacing/ToMapNoSpace.txt b/dhall/tests/parser/failure/spacing/ToMapNoSpace.txt new file mode 100644 index 0000000..afb7c29 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/ToMapNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:1 + | +1 | toMap(x)␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt b/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt new file mode 100644 index 0000000..0a83dc8 --- /dev/null +++ b/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | < x :T >␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/surrogatePairUnbraced.txt b/dhall/tests/parser/failure/surrogatePairUnbraced.txt new file mode 100644 index 0000000..5cf6ab4 --- /dev/null +++ b/dhall/tests/parser/failure/surrogatePairUnbraced.txt @@ -0,0 +1,6 @@ + --> 5:3 + | +5 | "\uD800"␊ + | ^---^ + | + = Escape sequences can't contain surrogate pairs diff --git a/dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt b/dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt new file mode 100644 index 0000000..7561fd7 --- /dev/null +++ b/dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | True@0␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt b/dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt new file mode 100644 index 0000000..6a8814f --- /dev/null +++ b/dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | Bool@1␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt b/dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt new file mode 100644 index 0000000..f06e887 --- /dev/null +++ b/dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt @@ -0,0 +1,6 @@ + --> 1:5 + | +1 | Type@0␊ + | ^--- + | + = expected EOI, import_alt, bool_or, natural_plus, text_append, list_append, bool_and, natural_times, bool_eq, bool_ne, combine, combine_types, equivalent, prefer, or arrow diff --git a/dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt b/dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt new file mode 100644 index 0000000..a02d38e --- /dev/null +++ b/dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt @@ -0,0 +1,6 @@ + --> 1:6 + | +1 | env:"\$"␊ + | ^--- + | + = expected posix_environment_variable_character diff --git a/dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt b/dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt new file mode 100644 index 0000000..c9d3216 --- /dev/null +++ b/dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | ([]) : List T␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/unit/ListLitEmptyMissingAnnotation.txt b/dhall/tests/parser/failure/unit/ListLitEmptyMissingAnnotation.txt new file mode 100644 index 0000000..5c8dfbc --- /dev/null +++ b/dhall/tests/parser/failure/unit/ListLitEmptyMissingAnnotation.txt @@ -0,0 +1,6 @@ + --> 1:2 + | +1 | []␊ + | ^--- + | + = expected expression diff --git a/dhall/tests/parser/failure/unit/MergeAlone.txt b/dhall/tests/parser/failure/unit/MergeAlone.txt new file mode 100644 index 0000000..43e7223 --- /dev/null +++ b/dhall/tests/parser/failure/unit/MergeAlone.txt @@ -0,0 +1,6 @@ + --> 2:1 + | +2 | + | ^--- + | + = expected import_hashed or primitive_expression diff --git a/dhall/tests/parser/failure/unit/MergeOneArgument.txt b/dhall/tests/parser/failure/unit/MergeOneArgument.txt new file mode 100644 index 0000000..43e7223 --- /dev/null +++ b/dhall/tests/parser/failure/unit/MergeOneArgument.txt @@ -0,0 +1,6 @@ + --> 2:1 + | +2 | + | ^--- + | + = expected import_hashed or primitive_expression diff --git a/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt b/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt new file mode 100644 index 0000000..8475bb9 --- /dev/null +++ b/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | < x = 3 | y : Bool >␊ + | ^--- + | + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall diff --git a/dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt b/dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt new file mode 100644 index 0000000..80434d3 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt @@ -0,0 +1,6 @@ + --> 1:9 + | +1 | { x: T, }␊ + | ^--- + | + = expected any_label_or_some diff --git a/dhall/tests/parser/failure/unit/SomeAlone.txt b/dhall/tests/parser/failure/unit/SomeAlone.txt new file mode 100644 index 0000000..43e7223 --- /dev/null +++ b/dhall/tests/parser/failure/unit/SomeAlone.txt @@ -0,0 +1,6 @@ + --> 2:1 + | +2 | + | ^--- + | + = expected import_hashed or primitive_expression -- cgit v1.2.3