-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Show evaluated test arguments for set/char/numeric comparison functions #57820
Conversation
I'm considering expanding this functionality further to evaluated arguments for any 1/2 argument function call. |
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.
Most of these are clear improvements and an easy merge. The issetequal
and issubset
functions are a bit iffy because they might be come less readable in the case of large objects:
julia> using Test
julia> x = rand(10000);
julia> @test issubset(x[1:100], x)
Test Passed
julia> @test issubset(x, x[1:100])
Test Failed at REPL[4]:1
Expression: issubset(x, x[1:100])
TBH I'm fine with including them if you want, regardless.
True, however we can already see the evaluate output for julia> using Test
julia> x = rand(10000);
julia> @test Set(x) ⊆ Set(x[1:100])
Test Failed at REPL[4]:1
Expression: Set(x) ⊆ Set(x[1:100])
Evaluated: Set([0.610825218143219, 0.07609558482085998, 0.6472379469621696, 0.2866250518445128, 0.9894449007594035, 0.5896579008491469, 0.43901414917292614, 0.17669143107161656, 0.6027709720821334, 0.7507150294850947 … 0.6401123629705973, 0.8328115919098275, 0.8655849484323953, 0.04856521127506497, 0.6974018123218493, 0.15446669145578185, 0.022489484375737723, 0.7115874557949187, 0.9301378413142882, 0.20743897739462058]) ⊆ Set([0.08236731303653522, 0.013527805966567885, 0.3587710294990768, 0.33806174679565326, 0.13010121886943615, 0.7132695337183813, 0.5612640721162494, 0.42069056143135375, 0.46486952878111376, 0.6824664276902744 … 0.6985310136900829, 0.009170975815409044, 0.18339254712771613, 0.6401123629705973, 0.7236067219720211, 0.6782758185089984, 0.5871499370719643, 0.4262745626946086, 0.022489484375737723, 0.6150820937170625])
ERROR: There was an error during testing |
I'm going to see if we can move forward with #57825 first. We can hold off on merging this for now |
Closing in favor of #57825 |
Extends the list of functions introduced in #30721 which show their evaluated arguments when the
@test
fails. Having this makes it much easier at a glance to debug the problem:The original PR added some good tests for this functionality. The new functions are less complicated than
isapprox
so I was thinking additional tests wouldn't be required. I can add some if others feel differently.Alternative to: