File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -453,12 +453,22 @@ end
453
453
454
454
b = 1 : 2 # copy between AbstractArrays
455
455
bo = OffsetArray (1 : 2 , (- 3 ,))
456
- @test_throws BoundsError copyto! (a, b)
457
- fill! (a, - 1 )
458
- copyto! (a, bo)
459
- @test a[- 3 ] == - 1
460
- @test a[- 2 ] == 1
461
- @test a[- 1 ] == 2
456
+ if VERSION < v " 1.5-"
457
+ @test_throws BoundsError copyto! (a, b)
458
+ fill! (a, - 1 )
459
+ copyto! (a, bo)
460
+ @test a[- 3 ] == - 1
461
+ @test a[- 2 ] == 1
462
+ @test a[- 1 ] == 2
463
+ else
464
+ # the behavior of copyto! is corrected as the documentation says "first n element"
465
+ # https://github.com/JuliaLang/julia/pull/34049
466
+ fill! (a, - 1 )
467
+ copyto! (a, bo)
468
+ @test a[- 3 ] == 1
469
+ @test a[- 2 ] == 2
470
+ @test a[- 1 ] == - 1
471
+ end
462
472
fill! (a, - 1 )
463
473
copyto! (a, - 2 , bo)
464
474
@test a[- 3 ] == - 1
You can’t perform that action at this time.
0 commit comments