@@ -855,6 +855,26 @@ generic_map_tests(map, map!)
855855 # @test_throws BoundsError map!(+, ones(3), ones(2, 2), ones(2, 2))
856856end
857857
858+ @testset " #30624" begin
859+ # ## unstructured
860+ @test map! (+ , ones (3 ), ones (3 ), ones (3 ), [1 ]) == [3 , 1 , 1 ]
861+ @test map! (+ , ones (3 ), [1 ], ones (3 ), ones (3 )) == [3 , 1 , 1 ]
862+ @test map! (+ , [1 ], [1 ], [], []) == [1 ]
863+ @test map! (+ , [[1 ]], [1 ], [], []) == [[1 ]]
864+
865+ # TODO : decide if input axes & lengths should be validated
866+ # @test_throws BoundsError map!(+, ones(1), ones(2))
867+ # @test_throws BoundsError map!(+, ones(1), ones(2, 2))
868+
869+ @test map! (+ , ones (3 ), view (ones (2 , 3 ), 1 : 2 , 2 : 3 ), ones (3 )) == [2 , 2 , 2 ]
870+ @test map! (+ , ones (3 ), ones (2 , 2 ), ones (3 )) == [2 , 2 , 2 ]
871+
872+ # ## structured (all mapped arguments are <:AbstractArray equal ndims > 1)
873+ @test map! (+ , ones (4 ), ones (2 , 2 ), ones (2 , 2 )) == [2 , 2 , 2 , 2 ]
874+ @test map! (+ , ones (4 ), ones (2 , 2 ), ones (1 , 2 )) == [2 , 2 , 1 , 1 ]
875+ # @test_throws BoundsError map!(+, ones(3), ones(2, 2), ones(2, 2))
876+ end
877+
858878test_UInt_indexing (TestAbstractArray)
859879test_13315 (TestAbstractArray)
860880test_checksquare ()
0 commit comments