1
Fork 0

Check for escape sequences in Fluent resources

This commit is contained in:
clubby789 2023-03-29 16:00:48 +01:00
parent bf57e8ada6
commit 979c265a5d
9 changed files with 64 additions and 9 deletions

View file

@ -0,0 +1 @@
no_crate_bad_escape = don't use \n, \', or \"

View file

@ -92,3 +92,12 @@ mod missing_message_ref {
fluent_messages! { "./missing-message-ref.ftl" }
//~^ ERROR referenced message `message` does not exist
}
mod bad_escape {
use super::fluent_messages;
fluent_messages! { "./invalid-escape.ftl" }
//~^ ERROR invalid escape `\n`
//~| ERROR invalid escape `\"`
//~| ERROR invalid escape `\'`
}

View file

@ -83,5 +83,29 @@ LL | fluent_messages! { "./missing-message-ref.ftl" }
|
= help: you may have meant to use a variable reference (`{$message}`)
error: aborting due to 10 previous errors
error: invalid escape `\n` in Fluent resource
--> $DIR/test.rs:99:24
|
LL | fluent_messages! { "./invalid-escape.ftl" }
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: os-specific message
error: invalid escape `\"` in Fluent resource
--> $DIR/test.rs:99:24
|
LL | fluent_messages! { "./invalid-escape.ftl" }
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: os-specific message
error: invalid escape `\'` in Fluent resource
--> $DIR/test.rs:99:24
|
LL | fluent_messages! { "./invalid-escape.ftl" }
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: os-specific message
error: aborting due to 13 previous errors

View file

@ -1,4 +1,4 @@
error: found non-existing keyword `tadam` used in `#[doc(keyword = \"...\")]`
error: found non-existing keyword `tadam` used in `#[doc(keyword = "...")]`
--> $DIR/existing_doc_keyword.rs:10:1
|
LL | #[doc(keyword = "tadam")]