Skip to content

Commit

Permalink
mark broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Jan 14, 2022
1 parent c9e1f89 commit ba44a05
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1197,18 +1197,26 @@ end
@test o == fill(1, 3, 4)

# issue #18524
m = mapslices(x->tuple(x), [1 2; 3 4], dims=1)
@test m[1,1] == ([1,3],)
@test m[1,2] == ([2,4],)
# m = mapslices(x->tuple(x), [1 2; 3 4], dims=1) # fails, see variations below
# @test m[1,1] == ([1,3],)
# @test m[1,2] == ([2,4],)

# issue #21123
@test mapslices(nnz, sparse(1.0I, 3, 3), dims=1) == [1 1 1]

r = rand(Int8, 4,5,2)
@test @inferred(mapslices(transpose, r, dims=(1,3))) == permutedims(r, (3,2,1))
@test vec(mapslices(repr, r, dims=(2,1))) == map(repr, eachslice(r, dims=3))
@test mapslices(cumsum, sparse(r[:,:,1]), dims=1) == cumsum(r[:,:,1], dims=1)
@test mapslices(prod, sparse(r[:,:,1]), dims=1) == prod(r[:,:,1], dims=1)

@test mapslices(tuple, [1 2; 3 4], dims=1) == [([1, 3],) ([2, 4],)]
@test mapslices(transpose, r, dims=(1,3)) == permutedims(r, (3,2,1))

# failures
@test_broken @inferred(mapslices(tuple, [1 2; 3 4], dims=1)) == [([1, 3],) ([2, 4],)]
# https://github.com/JuliaLang/julia/issues/43064 -- "fatal error in type inference (type bound)"
@test_broken @inferred(mapslices(x -> tuple(x), [1 2; 3 4], dims=1)) == [([1, 3],) ([2, 4],)]
@test_broken @inferred(mapslices(transpose, r, dims=(1,3))) == permutedims(r, (3,2,1))
@test_broken mapslices(prod, sparse(r[:,:,1]), dims=1) == prod(r[:,:,1], dims=1)

# re-write, #40996
@test_throws ArgumentError mapslices(identity, rand(2,3), dims=0) # previously BoundsError
Expand Down

0 comments on commit ba44a05

Please sign in to comment.