From 7f1e2fc513a2d909af14f6c94a996787d0cce487 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:37:22 -0300 Subject: [PATCH] more decorator tests --- tests/suite/syntax/decorator.typ | 60 +++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/tests/suite/syntax/decorator.typ b/tests/suite/syntax/decorator.typ index b2d01d5f5..1ea214019 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 +#[**]