summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorMarmare314 <49279081+Marmare314@users.noreply.github.com>2023-04-20 11:05:11 +0200
committerGitHub <noreply@github.com>2023-04-20 11:05:11 +0200
commit4524539c2bc5f3a9f53bc57a1902264fc894969b (patch)
tree578dcc6b82b0d40d88eb5d6a6f07cbdc38ef10d0 /tests/typ
parentc505a0f5dccd120d97926f6ff5bbe0becf783aeb (diff)
forbid underscore as identifier closes #513 (#837)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compiler/closure.typ4
-rw-r--r--tests/typ/compiler/let.typ20
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/typ/compiler/closure.typ b/tests/typ/compiler/closure.typ
index 915de850..2d12a2bc 100644
--- a/tests/typ/compiler/closure.typ
+++ b/tests/typ/compiler/closure.typ
@@ -170,3 +170,7 @@
---
// Error: 10-14 expected identifier, found `none`
#let foo(none: b) = key
+
+---
+// Error: 11 expected comma
+#let foo(_: 3) = none
diff --git a/tests/typ/compiler/let.typ b/tests/typ/compiler/let.typ
index 70657617..160d2147 100644
--- a/tests/typ/compiler/let.typ
+++ b/tests/typ/compiler/let.typ
@@ -222,6 +222,26 @@ Three
#let (..true) = false
---
+#let _ = 4
+
+#for _ in range(2) []
+
+// Error: 2-3 unexpected underscore
+#_
+
+// Error: 8-9 unexpected underscore
+#lorem(_)
+
+// Error: 3-4 expected expression, found underscore
+#(_,)
+
+// Error: 3-4 expected expression, found underscore
+#{_}
+
+// Error: 8-9 expected expression, found underscore
+#{ 1 + _ }
+
+---
// Error: 13 expected equals sign
#let func(x)