-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Validate fluent variable references in tests #111269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
|
This comment has been minimized.
This comment has been minimized.
f516ce2
to
991625a
Compare
This comment has been minimized.
This comment has been minimized.
Hmm, doesn't work right now if the message is part of a subdiagnostic that defines the variable. |
f9cf57c
to
f4b9a1a
Compare
This comment has been minimized.
This comment has been minimized.
f4b9a1a
to
9f92ded
Compare
Why gate on debug_assertions? The only code changes are in macros and generated unit tests, so there is nothing that make the runtime slower. |
I didn't want to have the macro always generate code that would only be used in tests. I guess I could instead just make sure that everything emitted by the macro is |
9f92ded
to
4adf871
Compare
This comment was marked as resolved.
This comment was marked as resolved.
3360cb5
to
003ae4c
Compare
003ae4c
to
220bb61
Compare
debug_assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay in reviewing here - I like this, but is it possible to add a test for these new tests? Something that confirms a diagnostic struct without the correct variables will have an error?
@bors r+ |
…s, r=davidtwco Validate fluent variable references in tests Closes rust-lang#101109 Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
☀️ Test successful - checks-actions |
Finished benchmarking commit (08fd6f7): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 662s -> 662.942s (0.14%) |
Closes #101109
Under
cfg(test)
, thefluent_messages
macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a#[test]
that checks that each referenced variable exists in the structure it's applied to.