Skip to content

Commit c896ad2

Browse files
committed
add test
1 parent 9f51501 commit c896ad2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/asyncmap.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ len_only_iterable = (1,2,3,4,5)
5454
@test_throws ArgumentError asyncmap(identity, 1:10; batch_size="10")
5555
@test_throws ArgumentError asyncmap(identity, 1:10; ntasks="10")
5656

57+
# Check that we throw a `CapturedException` holding the stacktrace if `f` throws
58+
f42105(i) = i == 5 ? error("captured") : i
59+
let
60+
e = try
61+
asyncmap(f42105, 1:5)
62+
catch e
63+
e
64+
end
65+
@test e isa CapturedException
66+
@test e.ex == ErrorException("captured")
67+
@test e.processed_bt[2][1].func == :f42105
68+
end
69+
5770
include("generic_map_tests.jl")
5871
generic_map_tests(asyncmap, asyncmap!)
5972

0 commit comments

Comments
 (0)