summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLeedehai <18319900+Leedehai@users.noreply.github.com>2023-11-27 05:50:15 -0500
committerGitHub <noreply@github.com>2023-11-27 11:50:15 +0100
commitc354f00f79002bd51becf554a54cc99ef64e6f2d (patch)
treef3b9f5aca3c280161a2f44c54a0e143426c40701 /tests
parent0fbb1aaaaa04d93ae478df6dc268ab8fb13e2bf2 (diff)
Add test cases to verify lexer's identifier validation (#2773)
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/compiler/let.typ16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/typ/compiler/let.typ b/tests/typ/compiler/let.typ
index 60f930d4..accd9d04 100644
--- a/tests/typ/compiler/let.typ
+++ b/tests/typ/compiler/let.typ
@@ -33,6 +33,22 @@ Three
#test(v3, 3)
---
+// Test what constitutes a valid Typst identifier.
+// Ref: false
+#let name = 1
+#test(name, 1)
+#let name_ = 1
+#test(name_, 1)
+#let name-2 = 1
+#test(name-2, 1)
+#let name_2 = 1
+#test(name_2, 1)
+#let __name = 1
+#test(__name, 1)
+#let ůñıćóðė = 1
+#test(ůñıćóðė, 1)
+
+---
// Test parenthesised assignments.
// Ref: false
#let (a) = (1, 2)