summaryrefslogtreecommitdiff
path: root/tests/suite/syntax/comment.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-13 10:39:45 +0200
committerGitHub <noreply@github.com>2024-04-13 08:39:45 +0000
commit020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch)
treec0027ad22046e2726c22298461327823d6b88d53 /tests/suite/syntax/comment.typ
parent72dd79210602ecc799726fc096b078afbb47f299 (diff)
Better test runner (#3922)
Diffstat (limited to 'tests/suite/syntax/comment.typ')
-rw-r--r--tests/suite/syntax/comment.typ43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/suite/syntax/comment.typ b/tests/suite/syntax/comment.typ
new file mode 100644
index 00000000..ac3e1943
--- /dev/null
+++ b/tests/suite/syntax/comment.typ
@@ -0,0 +1,43 @@
+// Test line and block comments.
+
+--- comments ---
+// Line comment acts as spacing.
+A// you
+B
+
+// Block comment does not act as spacing, nested block comments.
+C/*
+ /* */
+*/D
+
+// Works in code.
+#test(type(/*1*/ 1) //
+, int)
+
+// End of block comment in line comment.
+// Hello */
+
+// Nested "//" doesn't count as line comment.
+/* // */
+E
+
+/*//*/
+This is a comment.
+*/*/
+
+--- comment-end-of-line ---
+// Test comments at the end of a line
+First part//
+Second part
+
+// Test comments at the end of a line with pre-spacing
+First part //
+Second part
+
+--- comment-block-unclosed ---
+// End should not appear without start.
+// Error: 7-9 unexpected end of block comment
+/* */ */
+
+// Unterminated is okay.
+/*