|
69 | 69 | A = rand(4, 4)
|
70 | 70 | @test fetch(@spawn sum(A; dims=1)) ≈ sum(A; dims=1)
|
71 | 71 |
|
72 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(@spawn sum(A; fakearg=2)) |
| 72 | + @test_throws_unwrap (Dagger.ThunkFailedException, MethodError) fetch(@spawn sum(A; fakearg=2)) |
73 | 73 |
|
74 | 74 | @test fetch(@spawn reduce(+, A; dims=1, init=2.0)) ≈
|
75 | 75 | reduce(+, A; dims=1, init=2.0)
|
|
187 | 187 | a = @spawn error("Test")
|
188 | 188 | wait(a)
|
189 | 189 | @test isready(a)
|
190 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(a) |
| 190 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(a) |
191 | 191 | b = @spawn 1+2
|
192 | 192 | @test fetch(b) == 3
|
193 | 193 | end
|
@@ -219,36 +219,36 @@ end
|
219 | 219 | @testset "single dependent" begin
|
220 | 220 | a = @spawn error("Test")
|
221 | 221 | b = @spawn a+2
|
222 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(a) |
| 222 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(a) |
223 | 223 | end
|
224 | 224 | @testset "multi dependent" begin
|
225 | 225 | a = @spawn error("Test")
|
226 | 226 | b = @spawn a+2
|
227 | 227 | c = @spawn a*2
|
228 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(b) |
229 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(c) |
| 228 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(b) |
| 229 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(c) |
230 | 230 | end
|
231 | 231 | @testset "dependent chain" begin
|
232 | 232 | a = @spawn error("Test")
|
233 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(a) |
| 233 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(a) |
234 | 234 | b = @spawn a+1
|
235 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(b) |
| 235 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(b) |
236 | 236 | c = @spawn b+2
|
237 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(c) |
| 237 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(c) |
238 | 238 | end
|
239 | 239 | @testset "single input" begin
|
240 | 240 | a = @spawn 1+1
|
241 | 241 | b = @spawn (a->error("Test"))(a)
|
242 | 242 | @test fetch(a) == 2
|
243 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(b) |
| 243 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(b) |
244 | 244 | end
|
245 | 245 | @testset "multi input" begin
|
246 | 246 | a = @spawn 1+1
|
247 | 247 | b = @spawn 2*2
|
248 | 248 | c = @spawn ((a,b)->error("Test"))(a,b)
|
249 | 249 | @test fetch(a) == 2
|
250 | 250 | @test fetch(b) == 4
|
251 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(c) |
| 251 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(c) |
252 | 252 | end
|
253 | 253 | @testset "diamond" begin
|
254 | 254 | a = @spawn 1+1
|
|
258 | 258 | @test fetch(a) == 2
|
259 | 259 | @test fetch(b) == 3
|
260 | 260 | @test fetch(c) == 4
|
261 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(d) |
| 261 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(d) |
262 | 262 | end
|
263 | 263 | end
|
264 | 264 | @testset "remote spawn" begin
|
|
276 | 276 | t1 = Dagger.@spawn 1+"fail"
|
277 | 277 | Dagger.@spawn t1+1
|
278 | 278 | end
|
279 |
| - @test_throws_unwrap Dagger.ThunkFailedException fetch(t2) |
| 279 | + @test_throws_unwrap (Dagger.ThunkFailedException, ErrorException) fetch(t2) |
280 | 280 | end
|
281 | 281 | @testset "undefined function" begin
|
282 | 282 | # Issues #254, #255
|
|
0 commit comments