Skip to content

Unit testing syntax @testset let #815

Open
@MilesCranmer

Description

@MilesCranmer

The new unit testing syntax on Julia 1.9 is extremely useful. For example:

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

ERROR: There was an error during testing

The downside is that it's only Julia 1.9, so I can't actually use it in my packages, as I want to maintain compatibility with Julia 1.6.

So, it would be great if this syntax could be added to Compat.jl!

Best,
Miles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions