summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-14 17:41:13 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-14 17:41:13 +0100
commit469d78d610085044845f0fba462f1d8170b62cd4 (patch)
tree18fe779679d316b271aaccc8a3cb007bcd692651 /tests
parent73b25bdad0f0dda66f0a73c8b980e0ddb1a59553 (diff)
Move let-binding tests to integration 🚚
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/lang/let.pngbin0 -> 1493 bytes
-rw-r--r--tests/typ/lang/let.typ20
-rw-r--r--tests/typeset.rs4
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/ref/lang/let.png b/tests/ref/lang/let.png
new file mode 100644
index 00000000..be9d8397
--- /dev/null
+++ b/tests/ref/lang/let.png
Binary files differ
diff --git a/tests/typ/lang/let.typ b/tests/typ/lang/let.typ
new file mode 100644
index 00000000..c7bba747
--- /dev/null
+++ b/tests/typ/lang/let.typ
@@ -0,0 +1,20 @@
+// Automatically initialized with `none`.
+#let x;
+{(x,)}
+
+// Can start with underscore.
+#let _y=1;
+{_y}
+
+// Multiline.
+#let z = "world"
+ + " 🌏"; Hello, {z}!
+
+// Error: 1:6-1:7 expected identifier, found integer
+#let 1;
+
+// Error: 4:1-4:3 unexpected identifier
+// Error: 3:4-3:9 unexpected identifier
+// Error: 3:1-3:1 expected semicolon
+#let x = ""
+Hi there
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 3eaca6ed..980e3a6c 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -204,14 +204,14 @@ fn test_part(i: usize, src: &str, env: &SharedEnv) -> (bool, Vec<Frame>) {
for diag in &diags {
if !ref_diags.contains(diag) {
- print!(" Unexpected | ");
+ print!(" Not annotated | ");
print_diag(diag, &map);
}
}
for diag in &ref_diags {
if !diags.contains(diag) {
- print!(" Missing | ");
+ print!(" Not emitted | ");
print_diag(diag, &map);
}
}