more decorator tests

This commit is contained in:
PgBiel 2024-06-20 23:37:22 -03:00
parent a320e92cfa
commit 7f1e2fc513

View File

@ -1,6 +1,11 @@
// Test decorators. // Test decorators.
--- decorator --- --- decorators ---
/! allow()
/! allow("A")
/! allow(5)
/! allow("the")
/! allow("unnecessary-stars") /! allow("unnecessary-stars")
#[*a*] #[*a*]
@ -14,3 +19,56 @@ $
/! allow("unnecessary-stars") /! allow("unnecessary-stars")
#[*a*] #[*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
#[**]