Skip to content

Commit

Permalink
Add compat to @test_throws
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Jul 1, 2022
1 parent bd7bd5e commit 901421a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ a matching function,
or a value (which will be tested for equality by comparing fields).
Note that `@test_throws` does not support a trailing keyword form.
!!! compat "Julia 1.7"
The ability to specify anything other than a type or a value as `exception` requires Julia v1.7 or later.
# Examples
```jldoctest
julia> @test_throws BoundsError [1, 2, 3][4]
Expand All @@ -701,7 +704,7 @@ In the final example, instead of matching a single string it could alternatively
- `["Try", "Complex"]` (a list of strings)
- `r"Try sqrt\\([Cc]omplex"` (a regular expression)
- `str -> occursin("complex", str)` (a matching function)
- `str -> occursin("complex", str)` (a matching function)
"""
macro test_throws(extype, ex)
orig_ex = Expr(:inert, ex)
Expand Down

0 comments on commit 901421a

Please sign in to comment.