Skip to content

Commit 8b5a985

Browse files
committed
fix tests (for array)
1 parent 8bce3d6 commit 8b5a985

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/testsuite/base.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,12 @@ end
339339
@test_throws BoundsError view(x, :, :, 1:10)
340340
end
341341

342-
@test compare(x -> selectdim(x, 3, 1), AT, rand(Float32, 2, 2, 2))
343-
let x = AT(rand(Float32, 5, 4, 3))
344-
@test typeof(view(x, :, :, 1:2)) == typeof(view(x, :, :, Base.Slice(Base.OneTo(2))))
345-
@test typeof(view(x, :, :, 1)) == typeof(view(x, :, Base.Slice(Base.OneTo(4)), 1))
346-
@test typeof(selectdim(x, 3, 1)) == typeof(view(x, :, :, 1))
342+
@testset "selectdim" begin
343+
@test compare(x -> selectdim(x, 3, 1), AT, rand(Float32, 2, 2, 2))
344+
let x = AT(rand(Float32, 5, 4, 3))
345+
@test typeof(selectdim(x, 3, 1)) == typeof(view(x, :, :, 1))
346+
@test typeof(selectdim(x, 2, 1)) == typeof(view(x, :, 1, :))
347+
end
347348
end
348349

349350
# bug in parentindices conversion

0 commit comments

Comments
 (0)