summaryrefslogtreecommitdiff
path: root/dhall/tests
diff options
context:
space:
mode:
authorNadrieril2020-11-05 00:18:38 +0000
committerNadrieril2020-11-05 19:42:00 +0000
commit8325de2db085bb0b3599bc453b658a1dacfe79ae (patch)
tree2407202f896068430356e0a1ce0d1dbb7590a6c8 /dhall/tests
parent442fd7517362ca4f8057699bc325af417fb7c6de (diff)
tests: add some tests
Diffstat (limited to 'dhall/tests')
-rw-r--r--dhall/tests/import/failure/unit/DontRecoverCycle.dhall1
-rw-r--r--dhall/tests/import/failure/unit/MissingFile.dhall1
-rw-r--r--dhall/tests/import/failure/unit/MissingFile.txt6
-rw-r--r--dhall/tests/import/success/unit/AlternativeWithVariableA.dhall1
-rw-r--r--dhall/tests/import/success/unit/AlternativeWithVariableB.dhall1
-rw-r--r--dhall/tests/import/success/unit/RecoverTransitiveFailureA.dhall1
-rw-r--r--dhall/tests/import/success/unit/RecoverTransitiveFailureB.dhall1
-rw-r--r--dhall/tests/normalization/success/regression/ComplexRecordSimplificationA.dhall1
-rw-r--r--dhall/tests/normalization/success/regression/ComplexRecordSimplificationB.dhall3
-rw-r--r--dhall/tests/normalization/success/unit/RecordSortFieldsA.dhall1
-rw-r--r--dhall/tests/normalization/success/unit/RecordSortFieldsB.dhall1
-rw-r--r--dhall/tests/normalization/success/unit/RecordTypeSortFieldsA.dhall1
-rw-r--r--dhall/tests/normalization/success/unit/RecordTypeSortFieldsB.dhall1
-rw-r--r--dhall/tests/normalization/success/unit/TextReplaceOverlappingA.dhall1
-rw-r--r--dhall/tests/normalization/success/unit/TextReplaceOverlappingB.dhall1
-rw-r--r--dhall/tests/spec.rs2
-rw-r--r--dhall/tests/type-inference/failure/unit/AssertAlphaTrap2.dhall1
17 files changed, 25 insertions, 0 deletions
diff --git a/dhall/tests/import/failure/unit/DontRecoverCycle.dhall b/dhall/tests/import/failure/unit/DontRecoverCycle.dhall
new file mode 100644
index 0000000..47b22f3
--- /dev/null
+++ b/dhall/tests/import/failure/unit/DontRecoverCycle.dhall
@@ -0,0 +1 @@
+../../../../../dhall-lang/tests/import/failure/cycle.dhall ? 0
diff --git a/dhall/tests/import/failure/unit/MissingFile.dhall b/dhall/tests/import/failure/unit/MissingFile.dhall
new file mode 100644
index 0000000..fdcd044
--- /dev/null
+++ b/dhall/tests/import/failure/unit/MissingFile.dhall
@@ -0,0 +1 @@
+./doesnt-exist.dhall
diff --git a/dhall/tests/import/failure/unit/MissingFile.txt b/dhall/tests/import/failure/unit/MissingFile.txt
new file mode 100644
index 0000000..de58996
--- /dev/null
+++ b/dhall/tests/import/failure/unit/MissingFile.txt
@@ -0,0 +1,6 @@
+Type error: error: error
+ --> <current file>:1:1
+ |
+1 | ./doesnt-exist.dhall
+ | ^^^^^^^^^^^^^^^^^^^^ No such file or directory (os error 2)
+ |
diff --git a/dhall/tests/import/success/unit/AlternativeWithVariableA.dhall b/dhall/tests/import/success/unit/AlternativeWithVariableA.dhall
new file mode 100644
index 0000000..31f3c6f
--- /dev/null
+++ b/dhall/tests/import/success/unit/AlternativeWithVariableA.dhall
@@ -0,0 +1 @@
+let x = 0 in (missing ? x)
diff --git a/dhall/tests/import/success/unit/AlternativeWithVariableB.dhall b/dhall/tests/import/success/unit/AlternativeWithVariableB.dhall
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/dhall/tests/import/success/unit/AlternativeWithVariableB.dhall
@@ -0,0 +1 @@
+0
diff --git a/dhall/tests/import/success/unit/RecoverTransitiveFailureA.dhall b/dhall/tests/import/success/unit/RecoverTransitiveFailureA.dhall
new file mode 100644
index 0000000..4508e54
--- /dev/null
+++ b/dhall/tests/import/success/unit/RecoverTransitiveFailureA.dhall
@@ -0,0 +1 @@
+../failure/MissingFile.dhall ? 0
diff --git a/dhall/tests/import/success/unit/RecoverTransitiveFailureB.dhall b/dhall/tests/import/success/unit/RecoverTransitiveFailureB.dhall
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/dhall/tests/import/success/unit/RecoverTransitiveFailureB.dhall
@@ -0,0 +1 @@
+0
diff --git a/dhall/tests/normalization/success/regression/ComplexRecordSimplificationA.dhall b/dhall/tests/normalization/success/regression/ComplexRecordSimplificationA.dhall
new file mode 100644
index 0000000..c41a3a7
--- /dev/null
+++ b/dhall/tests/normalization/success/regression/ComplexRecordSimplificationA.dhall
@@ -0,0 +1 @@
+\(foo: { x: Bool, y: Bool }) -> \(bar: { x: Bool }) -> (foo.{x, y} // bar).{ x }
diff --git a/dhall/tests/normalization/success/regression/ComplexRecordSimplificationB.dhall b/dhall/tests/normalization/success/regression/ComplexRecordSimplificationB.dhall
new file mode 100644
index 0000000..d7026a4
--- /dev/null
+++ b/dhall/tests/normalization/success/regression/ComplexRecordSimplificationB.dhall
@@ -0,0 +1,3 @@
+λ(foo : { x : Bool, y : Bool }) →
+λ(bar : { x : Bool }) →
+ (foo.{ x, y } ⫽ bar).{ x }
diff --git a/dhall/tests/normalization/success/unit/RecordSortFieldsA.dhall b/dhall/tests/normalization/success/unit/RecordSortFieldsA.dhall
new file mode 100644
index 0000000..8b7b5e4
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/RecordSortFieldsA.dhall
@@ -0,0 +1 @@
+{ b = 1, a = 0 }
diff --git a/dhall/tests/normalization/success/unit/RecordSortFieldsB.dhall b/dhall/tests/normalization/success/unit/RecordSortFieldsB.dhall
new file mode 100644
index 0000000..23aa2b4
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/RecordSortFieldsB.dhall
@@ -0,0 +1 @@
+{ a = 0, b = 1 }
diff --git a/dhall/tests/normalization/success/unit/RecordTypeSortFieldsA.dhall b/dhall/tests/normalization/success/unit/RecordTypeSortFieldsA.dhall
new file mode 100644
index 0000000..6b4be0e
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/RecordTypeSortFieldsA.dhall
@@ -0,0 +1 @@
+{ b : Bool, a : Natural }
diff --git a/dhall/tests/normalization/success/unit/RecordTypeSortFieldsB.dhall b/dhall/tests/normalization/success/unit/RecordTypeSortFieldsB.dhall
new file mode 100644
index 0000000..d52374f
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/RecordTypeSortFieldsB.dhall
@@ -0,0 +1 @@
+{ a : Natural, b : Bool }
diff --git a/dhall/tests/normalization/success/unit/TextReplaceOverlappingA.dhall b/dhall/tests/normalization/success/unit/TextReplaceOverlappingA.dhall
new file mode 100644
index 0000000..31ca0d9
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/TextReplaceOverlappingA.dhall
@@ -0,0 +1 @@
+Text/replace "aa" "b" "aaaaa"
diff --git a/dhall/tests/normalization/success/unit/TextReplaceOverlappingB.dhall b/dhall/tests/normalization/success/unit/TextReplaceOverlappingB.dhall
new file mode 100644
index 0000000..ab8b076
--- /dev/null
+++ b/dhall/tests/normalization/success/unit/TextReplaceOverlappingB.dhall
@@ -0,0 +1 @@
+"bba"
diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs
index 357181a..c9f607c 100644
--- a/dhall/tests/spec.rs
+++ b/dhall/tests/spec.rs
@@ -493,6 +493,8 @@ fn define_features() -> Vec<TestFeature> {
|| cfg!(windows)
// TODO: import headers
|| path == "customHeadersUsingBoundVariable"
+ // TODO: do not recover from cyclic imports
+ || path == "unit/DontRecoverCycle"
}),
output_type: FileType::UI,
..default_feature.clone()
diff --git a/dhall/tests/type-inference/failure/unit/AssertAlphaTrap2.dhall b/dhall/tests/type-inference/failure/unit/AssertAlphaTrap2.dhall
new file mode 100644
index 0000000..bbf13d4
--- /dev/null
+++ b/dhall/tests/type-inference/failure/unit/AssertAlphaTrap2.dhall
@@ -0,0 +1 @@
+\(_: Bool) -> assert : (\(_: Bool) -> _) === (\(x: Bool) -> _)