We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When writing tests, you sometimes want to assert that the entire test itself panics. Currently we have no way of doing so.
Im proposing some way of notating that a test must panic in order to succeed. If the test does not panic when it should, the test does not succeed.
A simple syntax that is inline with calling conventions could be something along the lines of:
test "name" conv(.ShouldPanic) { std.testing.expectEqual(true, false); }
The test above is considered succesfull, the convention says it expects a panic, which happens.
The default convention of tests would become conv(.NoPanic) or something along those lines.
conv(.NoPanic)
Some other languages also provide similar facilities in their tests, Rust for example has #[should_panic].
#[should_panic]
The text was updated successfully, but these errors were encountered:
@DutchGhost There is accepted #6621.
Sorry, something went wrong.
See #513 and #1356.
No branches or pull requests
When writing tests, you sometimes want to assert that the entire test itself panics. Currently we have no way of doing so.
Im proposing some way of notating that a test must panic in order to succeed. If the test does not panic when it should, the test does not succeed.
A simple syntax that is inline with calling conventions could be something along the lines of:
The test above is considered succesfull, the convention says it expects a panic, which happens.
The default convention of tests would become
conv(.NoPanic)
or something along those lines.Some other languages also provide similar facilities in their tests, Rust for example has
#[should_panic]
.The text was updated successfully, but these errors were encountered: