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

Test: support multiple assignments for @testset let #50151

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

aviatesk
Copy link
Sponsor Member

Nested ContextTestset is supported, so we can stack it when there are multiple assignments in a given let block.

julia> @testset let logi = log(im), op = !iszero
           @test imag(logi) == π/2
           @test op(real(logi))
       end
Test Failed at none:3
  Expression: !(iszero(real(logi)))
     Context: logi = 0.0 + 1.5707963267948966im
              op = !iszero

ERROR: There was an error during testing

@aviatesk aviatesk added the testsystem The unit testing framework and Test stdlib label Jun 13, 2023
@aviatesk aviatesk requested a review from Keno June 13, 2023 06:30
Nested `ContextTestset` is  supported, so we can stack it when there are
multiple assignments in a given `let` block.

```julia
julia> @testset let logi = log(im), op = !iszero
           @test imag(logi) == π/2
           @test op(real(logi))
       end
Test Failed at none:3
  Expression: !(iszero(real(logi)))
     Context: logi = 0.0 + 1.5707963267948966im
              op = !iszero

ERROR: There was an error during testing
```
@aviatesk aviatesk force-pushed the avi/testset-let-multiple-assigns branch from d23c65c to 7b9f7f4 Compare June 13, 2023 07:00
Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me.

@aviatesk aviatesk merged commit 0d89d8b into master Jun 13, 2023
1 check passed
@aviatesk aviatesk deleted the avi/testset-let-multiple-assigns branch June 13, 2023 10:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants