-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Better @assert
default failure message, like that given by @test
#21725
Comments
@test
@assert
default failure message, like that given by @test
Just curious: why not simply use |
They are not semantically the same operation. But eventually Also |
I agree with this general direction – if we're going to keep asserts. There's the question of whether we should or not, however, since people tend to abuse asserts for error checking instead of strictly using them for verifying the internal logic of their algorithms when testing. |
Related #15495 |
+1 for printing the actual value, currently you see message like
and you need to add |
Maybe there can be a different macro for this behavior otherwise @StefanKarpinski or should one always do |
when you fail a
@test
, you get a great message telling you what the expect value was and what the actual value was.With
@assert
, you do not.For example
I often fine myself writing things like:
but
@test
shows that this can be done automatically.I think that makes a better default, than just printing out what the expression was, without showing the values.
The text was updated successfully, but these errors were encountered: