From 72ad56209fe10e3120c19ca5b820ff267423ab1d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 11 Apr 2020 15:41:21 +0100 Subject: spec: fix precedence of `===` and `with` --- dhall/tests/parser/failure/unit/WithPrecedence1.txt | 6 ++++++ dhall/tests/parser/failure/unit/WithPrecedence2.txt | 6 ++++++ dhall/tests/parser/failure/unit/WithPrecedence3.txt | 6 ++++++ dhall/tests/parser/success/unit/WithPrecedence1B.txt | 1 + dhall/tests/parser/success/unit/WithPrecedence2B.txt | 1 + dhall/tests/parser/success/unit/WithPrecedence3B.txt | 1 + .../tests/parser/success/unit/operators/PrecedenceEquivalenceB.txt | 1 + 7 files changed, 22 insertions(+) create mode 100644 dhall/tests/parser/failure/unit/WithPrecedence1.txt create mode 100644 dhall/tests/parser/failure/unit/WithPrecedence2.txt create mode 100644 dhall/tests/parser/failure/unit/WithPrecedence3.txt create mode 100644 dhall/tests/parser/success/unit/WithPrecedence1B.txt create mode 100644 dhall/tests/parser/success/unit/WithPrecedence2B.txt create mode 100644 dhall/tests/parser/success/unit/WithPrecedence3B.txt create mode 100644 dhall/tests/parser/success/unit/operators/PrecedenceEquivalenceB.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/failure/unit/WithPrecedence1.txt b/dhall/tests/parser/failure/unit/WithPrecedence1.txt new file mode 100644 index 0000000..a1dfd31 --- /dev/null +++ b/dhall/tests/parser/failure/unit/WithPrecedence1.txt @@ -0,0 +1,6 @@ + --> 1:24 + | +1 | { x = 0 } // { y = 1 } with x = 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, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/unit/WithPrecedence2.txt b/dhall/tests/parser/failure/unit/WithPrecedence2.txt new file mode 100644 index 0000000..fefd172 --- /dev/null +++ b/dhall/tests/parser/failure/unit/WithPrecedence2.txt @@ -0,0 +1,6 @@ + --> 1:15 + | +1 | foo { x = 0 } with x = 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, arrow, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/failure/unit/WithPrecedence3.txt b/dhall/tests/parser/failure/unit/WithPrecedence3.txt new file mode 100644 index 0000000..418c669 --- /dev/null +++ b/dhall/tests/parser/failure/unit/WithPrecedence3.txt @@ -0,0 +1,6 @@ + --> 1:22 + | +1 | { x = 0 } with x = 1 : 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, import_hashed, or primitive_expression diff --git a/dhall/tests/parser/success/unit/WithPrecedence1B.txt b/dhall/tests/parser/success/unit/WithPrecedence1B.txt new file mode 100644 index 0000000..5f22335 --- /dev/null +++ b/dhall/tests/parser/success/unit/WithPrecedence1B.txt @@ -0,0 +1 @@ +{ a = Some 1 } ⫽ { a = Some 2 } ⫽ { a = Some 3 } diff --git a/dhall/tests/parser/success/unit/WithPrecedence2B.txt b/dhall/tests/parser/success/unit/WithPrecedence2B.txt new file mode 100644 index 0000000..f945cc9 --- /dev/null +++ b/dhall/tests/parser/success/unit/WithPrecedence2B.txt @@ -0,0 +1 @@ +{ x = 0 } ⫽ { x = 1 + 1 } diff --git a/dhall/tests/parser/success/unit/WithPrecedence3B.txt b/dhall/tests/parser/success/unit/WithPrecedence3B.txt new file mode 100644 index 0000000..a801b24 --- /dev/null +++ b/dhall/tests/parser/success/unit/WithPrecedence3B.txt @@ -0,0 +1 @@ +foo::{ x = 0 } ⫽ { x = 1 } diff --git a/dhall/tests/parser/success/unit/operators/PrecedenceEquivalenceB.txt b/dhall/tests/parser/success/unit/operators/PrecedenceEquivalenceB.txt new file mode 100644 index 0000000..717c108 --- /dev/null +++ b/dhall/tests/parser/success/unit/operators/PrecedenceEquivalenceB.txt @@ -0,0 +1 @@ +2 + 3 * 4 ≡ 4 * 3 + 2 -- cgit v1.2.3 From 9da112a1985124f549254943c81495e637fb43cc Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 11 Apr 2020 22:05:00 +0100 Subject: spec: allow unions with mixed kinds --- dhall/tests/type-inference/failure/mixedUnions.txt | 6 ------ dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt | 6 ------ .../failure/unit/RightBiasedRecordMergeMixedKinds2.txt | 6 ------ .../failure/unit/RightBiasedRecordMergeMixedKinds3.txt | 6 ------ dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt | 6 ------ dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt | 6 ------ dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt | 6 ------ 7 files changed, 42 deletions(-) delete mode 100644 dhall/tests/type-inference/failure/mixedUnions.txt delete mode 100644 dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt delete mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt delete mode 100644 dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt delete mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt delete mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt delete mode 100644 dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt (limited to 'dhall/tests') diff --git a/dhall/tests/type-inference/failure/mixedUnions.txt b/dhall/tests/type-inference/failure/mixedUnions.txt deleted file mode 100644 index 2b307d0..0000000 --- a/dhall/tests/type-inference/failure/mixedUnions.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidVariantType - --> :1:28 - | -1 | < Left : Natural | Right : Type > - | ^^^^ InvalidVariantType - | diff --git a/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt deleted file mode 100644 index a83bb4f..0000000 --- a/dhall/tests/type-inference/failure/unit/RecordMixedKinds3.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:17 - | -1 | { x = Type, y = Kind } - | ^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt deleted file mode 100644 index 6a6da80..0000000 --- a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:22 - | -1 | { x = Bool } ⫽ { x = Kind } - | ^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt deleted file mode 100644 index 322e7f4..0000000 --- a/dhall/tests/type-inference/failure/unit/RightBiasedRecordMergeMixedKinds3.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidFieldType - --> :1:21 - | -1 | { x = {=} } ⫽ { x = Kind } - | ^^^^ InvalidFieldType - | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt deleted file mode 100644 index ae6c845..0000000 --- a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidVariantType - --> :1:18 - | -1 | < x : Bool | y : Type > - | ^^^^ InvalidVariantType - | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt deleted file mode 100644 index faf81a9..0000000 --- a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds2.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidVariantType - --> :1:18 - | -1 | < x : Kind | y : Type > - | ^^^^ InvalidVariantType - | diff --git a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt b/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt deleted file mode 100644 index bbfb1f3..0000000 --- a/dhall/tests/type-inference/failure/unit/UnionTypeMixedKinds3.txt +++ /dev/null @@ -1,6 +0,0 @@ -Type error: error: InvalidVariantType - --> :1:18 - | -1 | < x : Kind | y : Bool > - | ^^^^ InvalidVariantType - | -- cgit v1.2.3 From 233e17abd5ec68f2a964954fb42c23705e6fa62d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 11 Apr 2020 22:58:02 +0100 Subject: spec: update encoding of floating point values to RFC7049bis --- dhall/tests/parser/success/unit/DoubleLit16bitB.txt | 1 + dhall/tests/parser/success/unit/DoubleLit32bitB.txt | 1 + dhall/tests/parser/success/unit/DoubleLit64bitB.txt | 1 + dhall/tests/spec.rs | 15 +++------------ 4 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 dhall/tests/parser/success/unit/DoubleLit16bitB.txt create mode 100644 dhall/tests/parser/success/unit/DoubleLit32bitB.txt create mode 100644 dhall/tests/parser/success/unit/DoubleLit64bitB.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/success/unit/DoubleLit16bitB.txt b/dhall/tests/parser/success/unit/DoubleLit16bitB.txt new file mode 100644 index 0000000..9ad974f --- /dev/null +++ b/dhall/tests/parser/success/unit/DoubleLit16bitB.txt @@ -0,0 +1 @@ +5.5 diff --git a/dhall/tests/parser/success/unit/DoubleLit32bitB.txt b/dhall/tests/parser/success/unit/DoubleLit32bitB.txt new file mode 100644 index 0000000..f67efa2 --- /dev/null +++ b/dhall/tests/parser/success/unit/DoubleLit32bitB.txt @@ -0,0 +1 @@ +5555.5 diff --git a/dhall/tests/parser/success/unit/DoubleLit64bitB.txt b/dhall/tests/parser/success/unit/DoubleLit64bitB.txt new file mode 100644 index 0000000..f3714c3 --- /dev/null +++ b/dhall/tests/parser/success/unit/DoubleLit64bitB.txt @@ -0,0 +1 @@ +55555555555.5 diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index 37df91d..ee12bc7 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -51,7 +51,7 @@ impl FileType { match self { FileType::Text => TestFile::Source(file), FileType::Binary => TestFile::Binary(file), - FileType::Hash => TestFile::Binary(file), + FileType::Hash => TestFile::UI(file), FileType::UI => TestFile::UI(file), } } @@ -449,10 +449,6 @@ fn define_features() -> Vec { false // Pretty sure the test is incorrect || path == "unit/import/urls/quotedPathFakeUrlEncode" - // See https://github.com/pyfisch/cbor/issues/109 - || path == "double" - || path == "unit/DoubleLitExponentNoDot" - || path == "unit/DoubleLitSecretelyInt" }), output_type: FileType::Binary, ..default_feature.clone() @@ -518,13 +514,8 @@ fn define_features() -> Vec { directory: "semantic-hash/success/", variant: SpecTestKind::SemanticHash, exclude_path: Rc::new(|path: &str| { - false - // We don't support bignums - || path == "simple/integerToDouble" - // See https://github.com/pyfisch/cbor/issues/109 - || path == "prelude/Integer/toDouble/0" - || path == "prelude/Integer/toDouble/1" - || path == "prelude/Natural/toDouble/0" + // We don't support bignums + path == "simple/integerToDouble" }), output_type: FileType::Hash, ..default_feature.clone() -- cgit v1.2.3 From 2cb647a1af179662832fb978b90f0b1df6e3dc18 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 13:55:49 +0100 Subject: spec: allow quoted labels to be empty --- dhall/tests/parser/success/quotedLabelB.txt | 2 +- dhall/tests/parser/success/quotedRecordLabelB.txt | 1 + dhall/tests/parser/success/quotedUnionLabelB.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 dhall/tests/parser/success/quotedRecordLabelB.txt create mode 100644 dhall/tests/parser/success/quotedUnionLabelB.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/success/quotedLabelB.txt b/dhall/tests/parser/success/quotedLabelB.txt index 861ae0b..f8175de 100644 --- a/dhall/tests/parser/success/quotedLabelB.txt +++ b/dhall/tests/parser/success/quotedLabelB.txt @@ -1 +1 @@ -{ example1 = let `let` = 1 in `let`, example2 = let `:.` = 1 in `:.`, example3 = let `$ref` = 1 in `$ref` } +{ example1 = let `let` = 1 in `let`, example2 = let `:.` = 1 in `:.`, example3 = let `$ref` = 1 in `$ref`, example4 = let `` = 1 in `` } diff --git a/dhall/tests/parser/success/quotedRecordLabelB.txt b/dhall/tests/parser/success/quotedRecordLabelB.txt new file mode 100644 index 0000000..6e5a76b --- /dev/null +++ b/dhall/tests/parser/success/quotedRecordLabelB.txt @@ -0,0 +1 @@ +{ `` = 2, ` ` = 3, foo = 1 } diff --git a/dhall/tests/parser/success/quotedUnionLabelB.txt b/dhall/tests/parser/success/quotedUnionLabelB.txt new file mode 100644 index 0000000..1974ec2 --- /dev/null +++ b/dhall/tests/parser/success/quotedUnionLabelB.txt @@ -0,0 +1 @@ +< ``: Natural | ` `: Natural | foo: Natural > -- cgit v1.2.3 From e3cdf3f386b6a682981e6bdf6ca6d215b0d0788d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:06:24 +0100 Subject: spec: not all ABNF parsers like empty rules --- dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dhall/tests') diff --git a/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt index 0e1a879..051ff49 100644 --- a/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt @@ -3,4 +3,4 @@ 1 | { x :T }␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, forall, empty_record_literal, or record_type_entry + = expected missing, record_type_entry, if_, merge, NaN, Some_, toMap, assert, forall, or empty_record_literal -- cgit v1.2.3 From 812fb88102082493d1176aab7ee61b5339821492 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:09:24 +0100 Subject: spec: ensure `keyword` rule only matches keywords --- dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt | 2 +- dhall/tests/parser/failure/annotation.txt | 2 +- dhall/tests/parser/failure/spacing/ForallNoSpace.txt | 2 +- dhall/tests/parser/failure/spacing/LambdaNoSpace.txt | 2 +- dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt | 2 +- dhall/tests/parser/failure/spacing/MergeNoSpace2.txt | 2 +- dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt | 2 +- dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt | 2 +- dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt | 2 +- dhall/tests/parser/failure/unit/RecordLitPunDotted.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'dhall/tests') diff --git a/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt b/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt index 0586abb..3ce3b45 100644 --- a/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt +++ b/dhall/tests/parser/failure/ProjectionByTypeNeedsParens.txt @@ -3,4 +3,4 @@ 1 | r.{ x: T }␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/annotation.txt b/dhall/tests/parser/failure/annotation.txt index 3390d3e..648ef2b 100644 --- a/dhall/tests/parser/failure/annotation.txt +++ b/dhall/tests/parser/failure/annotation.txt @@ -3,4 +3,4 @@ 1 | let a:Natural = 1 in a␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/spacing/ForallNoSpace.txt b/dhall/tests/parser/failure/spacing/ForallNoSpace.txt index 697d400..6bd7fbc 100644 --- a/dhall/tests/parser/failure/spacing/ForallNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/ForallNoSpace.txt @@ -3,4 +3,4 @@ 1 | forall(x :T) -> x␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt b/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt index adb0f1f..e5d1089 100644 --- a/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/LambdaNoSpace.txt @@ -3,4 +3,4 @@ 1 | \(x :T) -> x␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt b/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt index 577f157..06aef2d 100644 --- a/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/LetAnnotNoSpace.txt @@ -3,4 +3,4 @@ 1 | let x :T = y in e␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt b/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt index 77314e0..0fba8c0 100644 --- a/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt +++ b/dhall/tests/parser/failure/spacing/MergeNoSpace2.txt @@ -3,4 +3,4 @@ 1 | merge x(y)␊ | ^--- | - = expected missing, non_empty_list_literal, double_quote_literal, single_quote_literal, if_, merge, NaN, Some_, toMap, assert, forall, numeric_double_literal, minus_infinity_literal, plus_infinity_literal, natural_literal, integer_literal, or import_hashed + = expected missing, non_empty_list_literal, double_quote_literal, single_quote_literal, if_, merge, NaN, Some_, toMap, assert, forall_keyword, numeric_double_literal, minus_infinity_literal, plus_infinity_literal, natural_literal, integer_literal, or import_hashed diff --git a/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt index 051ff49..759dd6f 100644 --- a/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/RecordTypeNoSpace.txt @@ -3,4 +3,4 @@ 1 | { x :T }␊ | ^--- | - = expected missing, record_type_entry, if_, merge, NaN, Some_, toMap, assert, forall, or empty_record_literal + = expected missing, record_type_entry, if_, merge, NaN, Some_, toMap, assert, forall_keyword, or empty_record_literal diff --git a/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt b/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt index 0a83dc8..8ff406c 100644 --- a/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt +++ b/dhall/tests/parser/failure/spacing/UnionTypeNoSpace.txt @@ -3,4 +3,4 @@ 1 | < x :T >␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt b/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt index 8475bb9..552a7c3 100644 --- a/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt +++ b/dhall/tests/parser/failure/unit/OldUnionLitSyntax.txt @@ -3,4 +3,4 @@ 1 | < x = 3 | y : Bool >␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword diff --git a/dhall/tests/parser/failure/unit/RecordLitPunDotted.txt b/dhall/tests/parser/failure/unit/RecordLitPunDotted.txt index 2e0ac22..429aa05 100644 --- a/dhall/tests/parser/failure/unit/RecordLitPunDotted.txt +++ b/dhall/tests/parser/failure/unit/RecordLitPunDotted.txt @@ -3,4 +3,4 @@ 1 | { x.y.z }␊ | ^--- | - = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall + = expected missing, if_, merge, NaN, Some_, toMap, assert, or forall_keyword -- cgit v1.2.3 From 8fd2fb4871335c72b9448da4a66144fd7f986f09 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:21:02 +0100 Subject: spec!: remove the ability to quote paths in URLs --- dhall/tests/parser/failure/unit/UrlWithQuotedPath.txt | 6 ++++++ dhall/tests/parser/success/unit/import/quotedPathsB.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 dhall/tests/parser/failure/unit/UrlWithQuotedPath.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/failure/unit/UrlWithQuotedPath.txt b/dhall/tests/parser/failure/unit/UrlWithQuotedPath.txt new file mode 100644 index 0000000..0b51f38 --- /dev/null +++ b/dhall/tests/parser/failure/unit/UrlWithQuotedPath.txt @@ -0,0 +1,6 @@ + --> 1:21 + | +1 | https://example.com/"a%20b"/c␊ + | ^--- + | + = 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/success/unit/import/quotedPathsB.txt b/dhall/tests/parser/success/unit/import/quotedPathsB.txt index 4705ca3..373b872 100644 --- a/dhall/tests/parser/success/unit/import/quotedPathsB.txt +++ b/dhall/tests/parser/success/unit/import/quotedPathsB.txt @@ -1 +1 @@ -{ example0 = /foo/bar/"baz qux", example1 = https://example.com/foo/bar%3Fbaz?qux } +/foo/bar/"baz qux" -- cgit v1.2.3 From 75929b8a3ca99ead6e10365439c40d2fe86dfe55 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:27:53 +0100 Subject: chore: garbage collect removed tests --- dhall/tests/parser/success/unit/WithPrecedenceB.txt | 1 - .../success/unit/import/urls/quotedPathFakeUrlEncodeB.txt | 1 - dhall/tests/spec.rs | 10 ---------- 3 files changed, 12 deletions(-) delete mode 100644 dhall/tests/parser/success/unit/WithPrecedenceB.txt delete mode 100644 dhall/tests/parser/success/unit/import/urls/quotedPathFakeUrlEncodeB.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/success/unit/WithPrecedenceB.txt b/dhall/tests/parser/success/unit/WithPrecedenceB.txt deleted file mode 100644 index 5f22335..0000000 --- a/dhall/tests/parser/success/unit/WithPrecedenceB.txt +++ /dev/null @@ -1 +0,0 @@ -{ a = Some 1 } ⫽ { a = Some 2 } ⫽ { a = Some 3 } diff --git a/dhall/tests/parser/success/unit/import/urls/quotedPathFakeUrlEncodeB.txt b/dhall/tests/parser/success/unit/import/urls/quotedPathFakeUrlEncodeB.txt deleted file mode 100644 index a8366d2..0000000 --- a/dhall/tests/parser/success/unit/import/urls/quotedPathFakeUrlEncodeB.txt +++ /dev/null @@ -1 +0,0 @@ -https://example.com/a%20b/c diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index ee12bc7..d9e2c56 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -413,11 +413,6 @@ fn define_features() -> Vec { directory: "parser/success/", variant: SpecTestKind::ParserSuccess, too_slow_path: Rc::new(|path: &str| path == "largeExpression"), - exclude_path: Rc::new(|path: &str| { - false - // Pretty sure the test is incorrect - || path == "unit/import/urls/quotedPathFakeUrlEncode" - }), output_type: FileType::Binary, ..default_feature.clone() }, @@ -445,11 +440,6 @@ fn define_features() -> Vec { directory: "parser/success/", variant: SpecTestKind::BinaryEncoding, too_slow_path: Rc::new(|path: &str| path == "largeExpression"), - exclude_path: Rc::new(|path: &str| { - false - // Pretty sure the test is incorrect - || path == "unit/import/urls/quotedPathFakeUrlEncode" - }), output_type: FileType::Binary, ..default_feature.clone() }, -- cgit v1.2.3 From ac7e39a752c41c06155e27e84404c67c1341065d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:28:48 +0100 Subject: spec!: remove Optional/build and Optional/fold --- dhall/tests/parser/success/builtinsB.txt | 2 +- .../failure/unit/LetWithNonterminatingAnnotation.txt | 12 ++++++++++++ .../failure/unit/RemovedBuiltinOptionalBuild.txt | 6 ++++++ .../failure/unit/RemovedBuiltinOptionalFold.txt | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt create mode 100644 dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt create mode 100644 dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/success/builtinsB.txt b/dhall/tests/parser/success/builtinsB.txt index 4e3ed79..1005949 100644 --- a/dhall/tests/parser/success/builtinsB.txt +++ b/dhall/tests/parser/success/builtinsB.txt @@ -1 +1 @@ -λ(x : { field0 : Bool, field1 : Optional (Optional Bool), field2 : Natural, field3 : Integer, field4 : Double, field5 : Text, field6 : List (List Bool) }) → { field00 = Natural/fold, field01 = Natural/build, field02 = Natural/isZero, field03 = Natural/even, field04 = Natural/odd, field05 = Natural/toInteger, field06 = Natural/show, field07 = Integer/show, field08 = Double/show, field09 = List/build, field10 = List/fold, field11 = List/length, field12 = List/head, field13 = List/last, field14 = List/indexed, field15 = List/reverse, field16 = Optional/fold, field17 = Optional/build, field18 = True, field19 = False, field20 = None } +[Natural/fold, Natural/build, Natural/isZero, Natural/even, Natural/odd, Natural/toInteger, Natural/show, Integer/toDouble, Integer/show, Integer/negate, Integer/clamp, Natural/subtract, Double/show, List/build, List/fold, List/length, List/head, List/last, List/indexed, List/reverse, Text/show, Bool, True, False, Optional, None, Natural, Integer, Double, Text, List, Type, Kind, Sort] diff --git a/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt b/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt new file mode 100644 index 0000000..6e360da --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt @@ -0,0 +1,12 @@ +Type error: error: expected function, found `Natural` + --> :6:25 + | + 1 | -- When you check if an inferred type is equivalent to an annotation, + 2 | -- you must alpha-beta-normalize both sides first. But it is not safe + 3 | -- to beta-normalise an expression which hasn't first been + 4 | -- typechecked. +... +10 | let a +11 | : (λ(x : Natural) → x x) (λ(x : Natural) → x x) + | ^ function application requires a function + | diff --git a/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt new file mode 100644 index 0000000..e4e285c --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable ``Optional/build`` + --> :1:1 + | +1 | Optional/build + | ^^^^^^^^^^^^^^ not found in this scope + | diff --git a/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt new file mode 100644 index 0000000..3d6c6aa --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable ``Optional/fold`` + --> :1:1 + | +1 | Optional/fold + | ^^^^^^^^^^^^^ not found in this scope + | -- cgit v1.2.3 From 61ad94761e8428c19ca06ebb100cd4ee06c02f5a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:35:25 +0100 Subject: spec: support Dhall v17.0.0 --- dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword00.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword01.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword02.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword03.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword04.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword05.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword06.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword07.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword08.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword09.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword10.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword11.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword12.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword13.txt | 6 ++++++ dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword14.txt | 6 ++++++ 15 files changed, 90 insertions(+) create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword00.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword01.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword02.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword03.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword04.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword05.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword06.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword07.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword08.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword09.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword10.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword11.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword12.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword13.txt create mode 100644 dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword14.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword00.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword00.txt new file mode 100644 index 0000000..9a8747b --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword00.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { if: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword01.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword01.txt new file mode 100644 index 0000000..d041384 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword01.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { then: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword02.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword02.txt new file mode 100644 index 0000000..2cdce47 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword02.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { else: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword03.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword03.txt new file mode 100644 index 0000000..b8dd809 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword03.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { let: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword04.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword04.txt new file mode 100644 index 0000000..4b2df06 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword04.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { in: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword05.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword05.txt new file mode 100644 index 0000000..23d4f75 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword05.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { using: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword06.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword06.txt new file mode 100644 index 0000000..4e715eb --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword06.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { missing: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword07.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword07.txt new file mode 100644 index 0000000..420dc77 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword07.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { assert: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword08.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword08.txt new file mode 100644 index 0000000..159e243 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword08.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { as: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword09.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword09.txt new file mode 100644 index 0000000..f5b7130 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword09.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { Infinity: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword10.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword10.txt new file mode 100644 index 0000000..dd6f552 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword10.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { NaN: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword11.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword11.txt new file mode 100644 index 0000000..ccf18aa --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword11.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { merge: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword12.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword12.txt new file mode 100644 index 0000000..f91f9dd --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword12.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { toMap: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword13.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword13.txt new file mode 100644 index 0000000..be64d1f --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword13.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { with: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal diff --git a/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword14.txt b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword14.txt new file mode 100644 index 0000000..9e2b836 --- /dev/null +++ b/dhall/tests/parser/failure/unit/RecordFieldMustNotBeKeyword14.txt @@ -0,0 +1,6 @@ + --> 1:3 + | +1 | { forall: Text }␊ + | ^--- + | + = expected any_label_or_some or empty_record_literal -- cgit v1.2.3 From 5dda920cc988bbd332353eea5f310f2798d4ff8c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 15:23:02 +0100 Subject: fix: ignore a test on Windows --- dhall/tests/spec.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'dhall/tests') diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index d9e2c56..d7f1564 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -479,6 +479,7 @@ fn define_features() -> Vec { || path == "noHeaderForwarding" // TODO: git changes newlines on windows || (cfg!(windows) && path == "unit/AsText") + || (cfg!(windows) && path == "unit/QuotedPath") // TODO: paths on windows have backslashes; this breaks all the `as Location` tests // See https://github.com/dhall-lang/dhall-lang/issues/1032 || (cfg!(windows) && path.contains("asLocation")) -- cgit v1.2.3 From 8719a9332eaab35ef671b954def018bc5dcddcf9 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 16:29:46 +0100 Subject: fix: exclude prelude test for now It's broken because cached imports get alpha-normalized. Those tests should be run with a dummy cache. --- dhall/tests/spec.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dhall/tests') diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index d7f1564..79747a4 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -541,7 +541,9 @@ fn define_features() -> Vec { module_name: "type_inference_success", directory: "type-inference/success/", variant: SpecTestKind::TypeInferenceSuccess, - too_slow_path: Rc::new(|path: &str| path == "prelude"), + // TODO: this fails because of caching shenanigans + // too_slow_path: Rc::new(|path: &str| path == "prelude"), + exclude_path: Rc::new(|path: &str| path == "prelude"), ..default_feature.clone() }, TestFeature { -- cgit v1.2.3 From b9c7bf6744fcbf30b988a50fd0b8c28e23f22d29 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 16:31:48 +0100 Subject: fix: always set XDG_CACHE_HOME in tests. We do NOT want to write in real directories during tests, but it's even worse if it's the user's directory. We really need a non-stupid cache abstraction. --- dhall/tests/spec.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'dhall/tests') diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index 79747a4..77d2aaa 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -598,6 +598,17 @@ fn run_test(test: &SpecTest) -> Result<()> { // Set environment variable for import tests. env::set_var("DHALL_TEST_VAR", "6 * 7"); + // Configure cache for import tests + env::set_var( + "XDG_CACHE_HOME", + root_dir + .join("dhall-lang") + .join("tests") + .join("import") + .join("cache") + .as_path(), + ); + let SpecTest { input: expr, output: expected, @@ -646,16 +657,6 @@ fn run_test(test: &SpecTest) -> Result<()> { expected.compare_ui(parsed)?; } ImportSuccess => { - // Configure cache for import tests - env::set_var( - "XDG_CACHE_HOME", - root_dir - .join("dhall-lang") - .join("tests") - .join("import") - .join("cache") - .as_path(), - ); let expr = expr.normalize()?; expected.compare(expr)?; } -- cgit v1.2.3