Add test for fluent diagnostics
This commit is contained in:
parent
46b0f8bafc
commit
0a253246f7
11
tests/ui-fulldeps/fluent-messages/many-lines.ftl
Normal file
11
tests/ui-fulldeps/fluent-messages/many-lines.ftl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
no_crate_foo = foo
|
||||||
|
|
||||||
|
# This file tests error reporting for
|
||||||
|
# fluent files with many lines.
|
||||||
|
# The error message should point to the correct line number
|
||||||
|
# and include no more context than necessary.
|
||||||
|
|
||||||
|
no_crate_bar =
|
||||||
|
|
||||||
|
no_crate_baz =
|
||||||
|
baz
|
@ -80,3 +80,8 @@ mod bad_escape {
|
|||||||
//~| ERROR invalid escape `\"`
|
//~| ERROR invalid escape `\"`
|
||||||
//~| ERROR invalid escape `\'`
|
//~| ERROR invalid escape `\'`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod many_lines {
|
||||||
|
rustc_fluent_macro::fluent_messages! { "./many-lines.ftl" }
|
||||||
|
//~^ ERROR could not parse Fluent resource
|
||||||
|
}
|
||||||
|
@ -103,5 +103,20 @@ LL | rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" }
|
|||||||
|
|
|
|
||||||
= note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
|
= note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
|
||||||
|
|
||||||
error: aborting due to 13 previous errors
|
error: could not parse Fluent resource
|
||||||
|
--> $DIR/test.rs:85:44
|
||||||
|
|
|
||||||
|
LL | rustc_fluent_macro::fluent_messages! { "./many-lines.ftl" }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= help: see additional errors emitted
|
||||||
|
|
||||||
|
error: expected a message field for "no_crate_bar"
|
||||||
|
--> ./many-lines.ftl:15:1
|
||||||
|
|
|
||||||
|
15 | no_crate_bar =
|
||||||
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
|
||||||
|
error: aborting due to 14 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user