summaryrefslogtreecommitdiff
path: root/dhall/tests
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-02-06 17:05:30 +0000
committerGitHub2020-02-06 17:05:30 +0000
commitce289aeb3db3085a327e3a509f69edcea0f86be0 (patch)
tree1f60a5f9007fc8a6df15873e55bf46ed2bd4ec26 /dhall/tests
parenteb9129312edf574948df777acb340189dc147724 (diff)
parentc27d8ff15988b914d21135dadffe9871441c127f (diff)
Merge pull request #129 from Nadrieril/missing-features
Implement some missing features
Diffstat (limited to 'dhall/tests')
-rw-r--r--dhall/tests/type-errors/unit/EmptyToMap.txt6
-rw-r--r--dhall/tests/type-errors/unit/HeterogenousToMap.txt6
-rw-r--r--dhall/tests/type-errors/unit/MistypedToMap1.txt6
-rw-r--r--dhall/tests/type-errors/unit/MistypedToMap2.txt6
-rw-r--r--dhall/tests/type-errors/unit/MistypedToMap3.txt6
-rw-r--r--dhall/tests/type-errors/unit/MistypedToMap4.txt6
-rw-r--r--dhall/tests/type-errors/unit/NonRecordToMap.txt6
-rw-r--r--dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt7
-rw-r--r--dhall/tests/type-errors/unit/ToMapWrongKind.txt6
9 files changed, 55 insertions, 0 deletions
diff --git a/dhall/tests/type-errors/unit/EmptyToMap.txt b/dhall/tests/type-errors/unit/EmptyToMap.txt
new file mode 100644
index 0000000..000fac7
--- /dev/null
+++ b/dhall/tests/type-errors/unit/EmptyToMap.txt
@@ -0,0 +1,6 @@
+Type error: error: `toMap` applied to an empty record requires a type annotation
+ --> <current file>:1:0
+ |
+1 | toMap {=}
+ | ^^^^^^^^^ `toMap` applied to an empty record requires a type annotation
+ |
diff --git a/dhall/tests/type-errors/unit/HeterogenousToMap.txt b/dhall/tests/type-errors/unit/HeterogenousToMap.txt
new file mode 100644
index 0000000..2f8abf2
--- /dev/null
+++ b/dhall/tests/type-errors/unit/HeterogenousToMap.txt
@@ -0,0 +1,6 @@
+Type error: error: Every field of the record must have the same type
+ --> <current file>: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/MistypedToMap1.txt b/dhall/tests/type-errors/unit/MistypedToMap1.txt
new file mode 100644
index 0000000..14d9791
--- /dev/null
+++ b/dhall/tests/type-errors/unit/MistypedToMap1.txt
@@ -0,0 +1,6 @@
+Type error: error: Annotation mismatch
+ --> <current file>: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
new file mode 100644
index 0000000..88e303e
--- /dev/null
+++ b/dhall/tests/type-errors/unit/MistypedToMap2.txt
@@ -0,0 +1,6 @@
+Type error: error: Annotation mismatch
+ --> <current file>: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
new file mode 100644
index 0000000..6b3772d
--- /dev/null
+++ b/dhall/tests/type-errors/unit/MistypedToMap3.txt
@@ -0,0 +1,6 @@
+Type error: error: Annotation mismatch
+ --> <current file>: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
new file mode 100644
index 0000000..e0cf651
--- /dev/null
+++ b/dhall/tests/type-errors/unit/MistypedToMap4.txt
@@ -0,0 +1,6 @@
+Type error: error: Annotation mismatch
+ --> <current file>:1:0
+ |
+1 | toMap { foo= 1, bar= 4 } : List { mapKey : Text, mapValue : Text }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Annotation mismatch
+ |
diff --git a/dhall/tests/type-errors/unit/NonRecordToMap.txt b/dhall/tests/type-errors/unit/NonRecordToMap.txt
new file mode 100644
index 0000000..8e83002
--- /dev/null
+++ b/dhall/tests/type-errors/unit/NonRecordToMap.txt
@@ -0,0 +1,6 @@
+Type error: error: The argument to `toMap` must be a record
+ --> <current file>:1:0
+ |
+1 | toMap "text"
+ | ^^^^^^^^^^^^ The argument to `toMap` must be a record
+ |
diff --git a/dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt b/dhall/tests/type-errors/unit/ToMapEmptyInvalidAnnotation.txt
new file mode 100644
index 0000000..c28073e
--- /dev/null
+++ b/dhall/tests/type-errors/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 }`
+ --> <current file>: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
new file mode 100644
index 0000000..8158c08
--- /dev/null
+++ b/dhall/tests/type-errors/unit/ToMapWrongKind.txt
@@ -0,0 +1,6 @@
+Type error: error: `toMap` only accepts records of type `Type`
+ --> <current file>:1:0
+ |
+1 | toMap { x = Bool }
+ | ^^^^^^^^^^^^^^^^^^ `toMap` only accepts records of type `Type`
+ |