Add test for invalid variables
This commit is contained in:
parent
220bb61b33
commit
8969d97437
@ -3,3 +3,5 @@ no_crate_example = this is an example message used in testing
|
||||
.help = with a help
|
||||
.suggestion = with a suggestion
|
||||
.label = with a label
|
||||
|
||||
no_crate_bad_reference = {$r} does not exist
|
||||
|
21
tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
Normal file
21
tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// run-fail
|
||||
// compile-flags: --test
|
||||
// test that messages referencing non-existent fields cause test failures
|
||||
|
||||
#![feature(rustc_private)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_fluent_macro;
|
||||
extern crate rustc_macros;
|
||||
extern crate rustc_errors;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_errors::{SubdiagnosticMessage, DiagnosticMessage};
|
||||
extern crate rustc_session;
|
||||
|
||||
fluent_messages! { "./example.ftl" }
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(no_crate_bad_reference)]
|
||||
struct BadRef;
|
Loading…
Reference in New Issue
Block a user