9393
9494 # reduction
9595 @reduce C[_,j] := sum (i) A[i,j]
96- @test axes (C) == (1 : 1 , 7 : 15 ) # but perhaps the wrong answer!
96+ @test axes (C) == (1 : 1 , 7 : 15 )
97+ @test extrema (C) == (141 , 301 ) # was reading out of bounds, TransmuteDims bug
9798
9899 # slicing
99100 @test axes (@cast _[j] := A[:,j]) == (7 : 15 ,)
@@ -102,10 +103,12 @@ end
102103 @test axes (first (@cast _[j][i] := A[i,j])) == (0 : 1 ,)
103104
104105 using StaticArrays
105- @test_broken axes (@cast _[j] := A{:,j}) == (7 : 15 ,) # drops offset from container?
106- @test first (@cast _[j] := A{:,j}) === SVector (70 ,71 ) # ignores offset, to make static slice?
107- @test first (@cast _[j] := A{:2 ,j}) === SVector (70 ,71 )
108- # note that reinterpret(reshape, SVector{2,Int}, A) gives an error, but it only insists on 1st axis
106+ @test_throws Exception @cast _[j] := A{:,j} # similar error to reinterpret(reshape, SVector{2,Int}, A)
107+ @cast D[i,j] := i+ 10 j (i in 1 : 3 , j in 7 : 15 )
108+ @test axes (@cast _[j] := D{:,j}) == (7 : 15 ,)
109+ @test first (@cast _[j] := D{:,j}) === SVector (71 , 72 , 73 )
110+ @test first (@cast _[j] := D{:3 ,j}) === SVector (71 , 72 , 73 )
111+ @test_throws Exception @cast _[j] := D{:2 ,j} # wrong size
109112end
110113
111114@testset " tuples" begin
0 commit comments