Skip to content

Commit

Permalink
Missing tests for accumulate (#38943)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored Dec 25, 2020
1 parent 570384e commit 4d7289b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,14 @@ end
arr = randn(4)
@test accumulate(*, arr; init=1) accumulate(*, arr)

# bad kwarg
arr_B = similar(arr)
@test_throws ArgumentError accumulate(*, arr; bad_init=1)
@test_throws ArgumentError accumulate!(*, arr_B, arr; bad_init=1)
# must provide dims
md_arr = randn(4, 5)
@test_throws ArgumentError accumulate!(*, similar(md_arr), md_arr)

N = 5
for arr in [rand(Float64, N), rand(Bool, N), rand(-2:2, N)]
for (op, cumop) in [(+, cumsum), (*, cumprod)]
Expand Down

0 comments on commit 4d7289b

Please sign in to comment.