Skip to content

Commit 17ed45f

Browse files
authored
Array tests for convert and reverseind (#42366)
1 parent 2c9e051 commit 17ed45f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

test/abstractarray.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,9 @@ function test_primitives(::Type{T}, shape, ::Type{TestAbstractArray}) where T
514514
@test convert(Matrix, Y) == Y
515515
@test convert(Matrix, view(Y, 1:2, 1:2)) == Y
516516
@test_throws MethodError convert(Matrix, X)
517+
518+
# convert(::Type{Union{}}, A::AbstractMatrix)
519+
@test_throws MethodError convert(Union{}, X)
517520
end
518521

519522
mutable struct TestThrowNoGetindex{T} <: AbstractVector{T} end

test/arrayops.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,12 @@ end
15761576
@test reverse!(Any[]) == Any[]
15771577
end
15781578

1579+
@testset "reverseind" begin
1580+
@test reverseind([1, 2, 3], 2) == 2
1581+
@test reverseind([1, 2, 3], 0) == 4
1582+
@test reverseind([1, 2, 3], 3) == 1
1583+
end
1584+
15791585
@testset "reverse dim" begin
15801586
@test isequal(reverse([2,3,1], dims=1), [1,3,2])
15811587
@test_throws ArgumentError reverse([2,3,1], dims=2)

0 commit comments

Comments
 (0)