Skip to content
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

Improved consistency of @ inferred with other test macros #24829

Closed
c42f opened this issue Nov 29, 2017 · 2 comments
Closed

Improved consistency of @ inferred with other test macros #24829

c42f opened this issue Nov 29, 2017 · 2 comments
Labels
testsystem The unit testing framework and Test stdlib

Comments

@c42f
Copy link
Member

c42f commented Nov 29, 2017

As a heavy user of @inferred I'd like it to be a little more user friendly and consistent with the other testing macros. My main gripe is that it's a test in its own right; I'd like to be able to write @test_inferred f(x) and have it register with the current test set, rather than unilaterally throwing an exception on failure.

The @test_warn macro does exactly this, and also returns the result so that it can be composed with @test if desired:

@test (@test_warn "deprecated" num2hex(1)) == "0000000000000001"

See related discussion over at: #20348 (comment)

I think there's two separate decisions here:

  1. Make @inferred register the result with the current test set
  2. If this is done, consider renaming to @test_inferred for consistency with other testing macros.
@c42f
Copy link
Member Author

c42f commented Nov 29, 2017

Original discussion around @inferred: #5404

@fredrikekre
Copy link
Member

Related: #21098

@simonbyrne simonbyrne added the testsystem The unit testing framework and Test stdlib label Nov 30, 2022
@vtjnash vtjnash closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

No branches or pull requests

4 participants