Skip to content

Commit 4d7289b

Browse files
authored
Missing tests for accumulate (#38943)
1 parent 570384e commit 4d7289b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/arrayops.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,14 @@ end
25382538
arr = randn(4)
25392539
@test accumulate(*, arr; init=1) accumulate(*, arr)
25402540

2541+
# bad kwarg
2542+
arr_B = similar(arr)
2543+
@test_throws ArgumentError accumulate(*, arr; bad_init=1)
2544+
@test_throws ArgumentError accumulate!(*, arr_B, arr; bad_init=1)
2545+
# must provide dims
2546+
md_arr = randn(4, 5)
2547+
@test_throws ArgumentError accumulate!(*, similar(md_arr), md_arr)
2548+
25412549
N = 5
25422550
for arr in [rand(Float64, N), rand(Bool, N), rand(-2:2, N)]
25432551
for (op, cumop) in [(+, cumsum), (*, cumprod)]

0 commit comments

Comments
 (0)