Skip to content

Commit a9e6950

Browse files
committed
Test that invalid kwargs error
1 parent de6ca7a commit a9e6950

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/accumulate.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
AK.accumulate!(+, y; init=Int32(init), inclusive=false)
8282
@test all(Array(y) .== 10:19)
8383

84+
# Test that undefined kwargs are not accepted
85+
@test_throws MethodError AK.accumulate(+, y; init=10, dims=2, inclusive=false, bad=:kwarg)
86+
8487
# Testing different settings
8588
AK.accumulate!(+, array_from_host(ones(Int32, 1000)), init=0, inclusive=false,
8689
block_size=128,
@@ -186,6 +189,9 @@ end
186189
sh = Array(s)
187190
@test all([sh[i, :] == 10:19 for i in 1:10])
188191

192+
# Test that undefined kwargs are not accepted
193+
@test_throws MethodError AK.accumulate(+, v; init=10, dims=2, inclusive=false, bad=:kwarg)
194+
189195
# Testing different settings
190196
AK.accumulate(
191197
(x, y) -> x + 1,

0 commit comments

Comments
 (0)