summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-06-20 23:37:22 -0300
committerPgBiel <9021226+PgBiel@users.noreply.github.com>2024-06-26 12:17:53 -0300
commit7f1e2fc513a2d909af14f6c94a996787d0cce487 (patch)
treebccd7bfff16241f7f1bb3932eda21056829a2314
parenta320e92cfad7b97cdf0e36b45db87863c128798e (diff)
more decorator tests
-rw-r--r--tests/suite/syntax/decorator.typ60
1 files changed, 59 insertions, 1 deletions
diff --git a/tests/suite/syntax/decorator.typ b/tests/suite/syntax/decorator.typ
index b2d01d5f..1ea21401 100644
--- a/tests/suite/syntax/decorator.typ
+++ b/tests/suite/syntax/decorator.typ
@@ -1,6 +1,11 @@
// Test decorators.
---- decorator ---
+--- decorators ---
+
+/! allow()
+/! allow("A")
+/! allow(5)
+/! allow("the")
/! allow("unnecessary-stars")
#[*a*]
@@ -14,3 +19,56 @@ $
/! allow("unnecessary-stars")
#[*a*]
$
+
+--- unknown-decorator ---
+/! whatever()
+
+--- invalid-decorator ---
+// Error: 1-13 the character * is not valid in a decorator
+/! invalid(*)
+
+--- allow-suppresses-warns ---
+
+/! allow("unnecessary-stars")
+#[**]
+
+/! allow("unnecessary-stars")
+#{
+ {
+ [**]
+ }
+}
+
+/**/ /! allow("unnecessary-stars")
+#[**]
+
+/! allow("unnecessary-stars")
+**
+
+--- allow-before-parbreak-doesnt-suppress-warn ---
+// Warning: 3:3-3:5 no text within stars
+// Hint: 3:3-3:5 using multiple consecutive stars (e.g. **) has no additional effect
+/! allow("unnecessary-stars")
+
+#[**]
+
+--- allow-before-empty-code-line-doesnt-suppress-warn ---
+// Warning: 4:4-4:6 no text within stars
+// Hint: 4:4-4:6 using multiple consecutive stars (e.g. **) has no additional effect
+#{
+ /! allow("unnecessary-stars")
+
+ [**]
+}
+
+--- unattached-allow-doesnt-suppress-warn ---
+
+// Warning: 1-3 no text within stars
+// Hint: 1-3 using multiple consecutive stars (e.g. **) has no additional effect
+**
+
+/! allow("unnecessary-stars")
+b
+// Warning: 3-5 no text within stars
+// Hint: 3-5 using multiple consecutive stars (e.g. **) has no additional effect
+#[**]