Skip to content

Commit 40c38f2

Browse files
committed
Try to fix test for older versions
1 parent 711a5b4 commit 40c38f2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_evaluation.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,25 @@ X = randn(Float32, 10);
120120
tree(X)[1]
121121
@test false
122122
catch e
123-
@test isa(e, ErrorException)
123+
@test e isa ErrorException
124124
# Check that "Failed to evaluate" is in the message:
125125
@test occursin("Failed to evaluate", e.msg)
126126
current_exceptions()
127127
end;
128128
@test length(stack) == 2
129-
@test isa(stack[1].exception, DomainError)
129+
@test stack[1].exception isa DomainError
130130

131131
# If a method is not defined, we should get a nothing:
132132
X = randn(Float32, 1, 10);
133133
@test tree(X; throw_errors=false) === nothing
134134
# or a MethodError:
135-
try
135+
@noinline stack = try
136136
tree(X; throw_errors=true)
137137
@test false
138138
catch e
139-
@test isa(current_exceptions()[1].exception, MethodError)
139+
@test e isa ErrorException
140+
@test occursin("Failed to evaluate", e.msg)
141+
current_exceptions()
140142
end
143+
@test length(stack) == 2
144+
@test stack[1].exception isa MethodError

0 commit comments

Comments
 (0)