Skip to content

Commit 46bd8e1

Browse files
committed
Add tests
1 parent c75bf3c commit 46bd8e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/test_setindex.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ end
2323
@test @set(arr[1] = 10) == [10, 2, 3]
2424
@test arr == [1,2,3]
2525
@test Setfield.setindex(arr, 10.0, 1) ==ₜ Float64[10.0, 2.0, 3.0]
26+
@test Setfield.setindex(ones(2, 2), zeros(2), 1, :) ==ₜ Float64[0.0 0.0; 1.0 1.0]
27+
@test Setfield.setindex(ones(BigInt, 2, 2), zeros(Float32, 2), 1, :) ==ₜ BigFloat[0.0 0.0; 1.0 1.0]
28+
@test Setfield.setindex(fill(ones(1), 2, 2), [im, im], :, 1) ==ₜ Any[[im, im];; [[1.0], [1.0]]]
2629

2730
d = Dict(:a => 1, :b => 2)
2831
@test_throws MethodError Base.setindex(d, 10, :a)

0 commit comments

Comments
 (0)