-
-
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
added automatic keyword assignment support to test macro #38270
added automatic keyword assignment support to test macro #38270
Conversation
Awesome, looks good to me! Could you also add a test for this case? Have a look in |
Sure, I shall add the necessary tests. |
The required tests have been added. |
I don't understand the purpose of this whole block of code --- the |
I think kwargs are normalized to enable pretty printing for failed tests, where the actual values passed to a function call get interpolated for printing. E.g., this produces the following output:
I don't think there's a much better way around doing this transformation for the automatic keyword assignment syntax. The |
I see. We don't need to refactor this now but it would be better to "parse" the arguments out of the expression just once, instead of parsing, re-forming an Expr, and then re-parsing in |
Actually when the argument expression contains an unassigned keyword like |
Yes, semantically it's a keyword argument, but you are right, in the AST it's just a symbol.
The basic gist is that |
@DebadityaPal Do you want to update this for the |
I would prefer to work on that issue over a second PR, as it could take me some time and it wouldn't be fruitful if the current changes are put on hold for that. |
Nevermind my previous comment, I have added the |
Awesome, thank you! |
Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com>
* added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit 6c42190)
* added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit 6c42190)
* added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit 6c42190)
…8270) * added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com>
* added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit 6c42190)
…ulia#38270) * added automatic keyword assignment support to @test macro * added some tests for test macro using atol keyword * x = a.x syntax support added * Update stdlib/Test/src/Test.jl Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit 740c19d)
As seen in #38215 , while passing keywords without assignment to test macro, the keyword is ignored. In these cases the keyword is passed as a Symbol in the metaprogram, I modified the macro functions so that it does not get ignored.
fixes #38215