summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2020-02-09 18:40:15 +0000
committerNadrieril2020-02-09 19:58:31 +0000
commit4c2a28b844b18d7b67278a1c8f628d9a95ea37c4 (patch)
treecf28b0104879bd73802c4a21c4ca76b298d1cb04 /dhall
parent02cacfd0360a0acea959c5a9b6d1b7fb0241db81 (diff)
Track error output of parsing and binary decoding tests
Diffstat (limited to '')
-rw-r--r--dhall/build.rs4
-rw-r--r--dhall/src/tests.rs12
-rw-r--r--dhall/tests/binary-decode/failure/unit/ApplyNoArgs.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/ListOneWithAnnotation.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/NaturalNegativeOne.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/OperatorOrTooFewArgs.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/OperatorOrTooManyArgs.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/OperatorUnknownOpcode.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore.txt1
-rw-r--r--dhall/tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore.txt1
-rw-r--r--dhall/tests/parser/failure/ImportHeadersExteriorHash.txt6
-rw-r--r--dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt6
-rw-r--r--dhall/tests/parser/failure/annotation.txt6
-rw-r--r--dhall/tests/parser/failure/boundBuiltins.txt6
-rw-r--r--dhall/tests/parser/failure/builtinWithIndex.txt6
-rw-r--r--dhall/tests/parser/failure/doubleBoundsNeg.txt6
-rw-r--r--dhall/tests/parser/failure/doubleBoundsPos.txt6
-rw-r--r--dhall/tests/parser/failure/fSomeX.txt6
-rw-r--r--dhall/tests/parser/failure/importAccess.txt6
-rw-r--r--dhall/tests/parser/failure/incompleteIf.txt6
-rw-r--r--dhall/tests/parser/failure/mandatoryNewline.txt6
-rw-r--r--dhall/tests/parser/failure/nonBase16Hash.txt6
-rw-r--r--dhall/tests/parser/failure/nonCharacter.txt6
-rw-r--r--dhall/tests/parser/failure/nonCharacterUnbraced.txt6
-rw-r--r--dhall/tests/parser/failure/nonUtf8.txt1
-rw-r--r--dhall/tests/parser/failure/spacing/AnnotationNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ApplicationNoSpace1.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ApplicationNoSpace2.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/AssertNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ForallNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/HeadersNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/IfNoSpace1.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/IfNoSpace2.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/IfNoSpace3.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ImportAltNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ImportHashedNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/LambdaNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/LetNoSpace1.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/LetNoSpace2.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ListLitEmptyNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/MergeAnnotationNoSpace3.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/MergeNoSpace1.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/MergeNoSpace2.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/NaturalPlusNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/SomeNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ToMapAnnotNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/ToMapNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt6
-rw-r--r--dhall/tests/parser/failure/surrogatePairUnbraced.txt6
-rw-r--r--dhall/tests/parser/failure/unit/BoolLitTrueWithIndex.txt6
-rw-r--r--dhall/tests/parser/failure/unit/BuiltinBoolWithIndex.txt6
-rw-r--r--dhall/tests/parser/failure/unit/BuiltinTypeWithIndex.txt6
-rw-r--r--dhall/tests/parser/failure/unit/ImportEnvWrongEscape.txt6
-rw-r--r--dhall/tests/parser/failure/unit/ListLitEmptyAnnotation.txt6
-rw-r--r--dhall/tests/parser/failure/unit/ListLitEmptyMissingAnnotation.txt6
-rw-r--r--dhall/tests/parser/failure/unit/MergeAlone.txt6
-rw-r--r--dhall/tests/parser/failure/unit/MergeOneArgument.txt6
-rw-r--r--dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt6
-rw-r--r--dhall/tests/parser/failure/unit/RecordTypeTrailingComma.txt6
-rw-r--r--dhall/tests/parser/failure/unit/SomeAlone.txt6
63 files changed, 325 insertions, 7 deletions
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