@@ -4,14 +4,16 @@ using Test, AxisKeys, BenchmarkTools
44
55 A = wrapdims (rand (2 ,3 ), 11.0 : 12.0 , [:a , :b , :c ])
66
7- # getindex
8- @test 0 == @ballocated $ A[1 , 1 ]
9- @test 272 >= @ballocated $ A[1 , :]
10- @test (@inferred A[1 , :]; true )
11- @test (@inferred view (A, 1 , :); true )
12-
13- # getkey
14- @test 32 >= @ballocated $ A (11.0 , :a )
7+ if VERSION >= v " 1.1"
8+ # getindex
9+ @test 0 == @ballocated $ A[1 , 1 ]
10+ @test 272 >= @ballocated $ A[1 , :]
11+ @test (@inferred A[1 , :]; true )
12+ @test (@inferred view (A, 1 , :); true )
13+
14+ # getkey
15+ @test 32 >= @ballocated $ A (11.0 , :a )
16+ end
1517
1618 al_A = @ballocated view ($ A,1 ,:) # 96
1719 @test al_A == @ballocated $ A (11.0 ,:)
@@ -25,10 +27,12 @@ using Test, AxisKeys, BenchmarkTools
2527 # with names
2628 N = wrapdims (rand (2 ,3 ), row= 11.0 : 12.0 , col= [:a , :b , :c ])
2729
28- @test 0 == @ballocated $ N[1 , 1 ]
29- @test 0 == @ballocated $ N[col= 1 , row= 1 ]
30- @test 288 >= @ballocated $ N[row= 1 ]
31- @test (@inferred N[row= 1 ]; true )
30+ if VERSION >= v " 1.1"
31+ @test 0 == @ballocated $ N[1 , 1 ]
32+ @test 0 == @ballocated $ N[col= 1 , row= 1 ]
33+ @test 288 >= @ballocated $ N[row= 1 ]
34+ @test (@inferred N[row= 1 ]; true )
35+ end
3236
3337 # extraction
3438 @test 0 == @ballocated axiskeys ($ N)
5862 @test 80 >= @ballocated KeyedArray ($ M, row= ' a' :' b' , col= 10 : 10 : 30 ) # 464 >=
5963 @test 80 >= @ballocated NamedDimsArray ($ M, row= ' a' :' b' , col= 10 : 10 : 30 ) # 400 >=
6064 end
61- @ballocated wrapdims ($ M, row= ' a' :' b' , col= 10 : 10 : 30 ) # 560 >=
65+ @test 560 >= @ ballocated wrapdims ($ M, row= ' a' :' b' , col= 10 : 10 : 30 ) # 560 >=
6266
6367 @test (@inferred KeyedArray (M, row= ' a' :' b' , col= 10 : 10 : 30 ); true )
6468 @test (@inferred NamedDimsArray (M, row= ' a' :' b' , col= 10 : 10 : 30 ); true )
0 commit comments