@@ -598,6 +598,31 @@ function test_get(::Type{TestAbstractArray})
598
598
@test get (TSlow ([]), (), 0 ) == 0
599
599
@test get (TSlow ([1 ]), (), 0 ) == 1
600
600
@test get (TSlow (fill (1 )), (), 0 ) == 1
601
+
602
+ global c = 0
603
+ f () = (global c = c+ 1 ; 0 )
604
+ @test get (f, A, ()) == 0
605
+ @test c == 1
606
+ @test get (f, B, ()) == 0
607
+ @test c == 2
608
+ @test get (f, A, (1 ,)) == get (f, A, 1 ) == A[1 ] == 1
609
+ @test c == 2
610
+ @test get (f, B, (1 ,)) == get (f, B, 1 ) == B[1 ] == 1
611
+ @test c == 2
612
+ @test get (f, A, (25 ,)) == get (f, A, 25 ) == 0
613
+ @test c == 4
614
+ @test get (f, B, (25 ,)) == get (f, B, 25 ) == 0
615
+ @test c == 6
616
+ @test get (f, A, (1 ,1 ,1 )) == A[1 ,1 ,1 ] == 1
617
+ @test get (f, B, (1 ,1 ,1 )) == B[1 ,1 ,1 ] == 1
618
+ @test get (f, A, (1 ,1 ,3 )) == 0
619
+ @test c == 7
620
+ @test get (f, B, (1 ,1 ,3 )) == 0
621
+ @test c == 8
622
+ @test get (f, TSlow ([]), ()) == 0
623
+ @test c == 9
624
+ @test get (f, TSlow ([1 ]), ()) == 1
625
+ @test get (f, TSlow (fill (1 )), ()) == 1
601
626
end
602
627
603
628
function test_cat (:: Type{TestAbstractArray} )
0 commit comments