summaryrefslogtreecommitdiffstats
path: root/src/test/ui-fulldeps/fluent-messages/test.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui-fulldeps/fluent-messages/test.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/test/ui-fulldeps/fluent-messages/test.rs66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/test/ui-fulldeps/fluent-messages/test.rs b/src/test/ui-fulldeps/fluent-messages/test.rs
new file mode 100644
index 000000000..0390a0785
--- /dev/null
+++ b/src/test/ui-fulldeps/fluent-messages/test.rs
@@ -0,0 +1,66 @@
+// normalize-stderr-test "note.*" -> "note: os-specific message"
+
+#![feature(rustc_private)]
+#![crate_type = "lib"]
+
+extern crate rustc_macros;
+use rustc_macros::fluent_messages;
+
+/// Copy of the relevant `DiagnosticMessage` variant constructed by `fluent_messages` as it
+/// expects `crate::DiagnosticMessage` to exist.
+pub enum DiagnosticMessage {
+ FluentIdentifier(std::borrow::Cow<'static, str>, Option<std::borrow::Cow<'static, str>>),
+}
+
+/// Copy of the relevant `SubdiagnosticMessage` variant constructed by `fluent_messages` as it
+/// expects `crate::SubdiagnosticMessage` to exist.
+pub enum SubdiagnosticMessage {
+ FluentAttr(std::borrow::Cow<'static, str>),
+}
+
+mod missing_absolute {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ missing_absolute => "/definitely_does_not_exist.ftl",
+//~^ ERROR could not open Fluent resource
+ }
+}
+
+mod missing_relative {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ missing_relative => "../definitely_does_not_exist.ftl",
+//~^ ERROR could not open Fluent resource
+ }
+}
+
+mod missing_message {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ missing_message => "./missing-message.ftl",
+//~^ ERROR could not parse Fluent resource
+ }
+}
+
+mod duplicate {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ a => "./duplicate-a.ftl",
+ b => "./duplicate-b.ftl",
+//~^ ERROR overrides existing message: `key`
+ }
+}
+
+mod valid {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ valid => "./valid.ftl",
+ }
+
+ use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid::valid};
+}