@@ -26,6 +26,8 @@ C = similar(A, 0)
26
26
D = similar (A)
27
27
@test size (A) == size (D)
28
28
@test eltype (A) == eltype (D)
29
+
30
+ # permutedims and transpose
29
31
@test axisnames (permutedims (A, (2 ,1 ,3 ))) == (:col , :row , :page )
30
32
@test axisnames (permutedims (A, (2 ,3 ,1 ))) == (:col , :page , :row )
31
33
@test axisnames (permutedims (A, (3 ,2 ,1 ))) == (:page , :col , :row )
@@ -35,6 +37,17 @@ for perm in ((:col, :row, :page), (:col, :page, :row),
35
37
(:row , :page , :col ), (:row , :col , :page ))
36
38
@test axisnames (permutedims (A, perm)) == perm
37
39
end
40
+ @test axisnames (permutedims (A, (:col ,))) == (:col , :row , :page )
41
+ @test axisnames (permutedims (A, (:page ,))) == (:page , :row , :col )
42
+ A2 = AxisArray (reshape (1 : 15 , 3 , 5 ))
43
+ A1 = AxisArray (1 : 5 , :t )
44
+ for f in (transpose, ctranspose)
45
+ @test f (A2). data == f (A2. data)
46
+ @test axisnames (f (A2)) == (:col , :row )
47
+ @test f (A1). data == f (A1. data)
48
+ @test axisnames (f (A1)) == (:transpose , :t )
49
+ end
50
+
38
51
# Test modifying a particular axis
39
52
E = similar (A, Float64, Axis {:col} (1 : 2 ))
40
53
@test size (E) == (2 ,2 ,4 )
0 commit comments