Skip to content

Commit 54fd671

Browse files
committed
replace MethodError at construction by TypeError at indexing
1 parent 0c17fc1 commit 54fd671

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stdlib/LinearAlgebra/test/adjtrans.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ using Test, LinearAlgebra, SparseArrays
77
@testset "Adjoint and Transpose inner constructor basics" begin
88
intvec, intmat = [1, 2], [1 2; 3 4]
99
# Adjoint/Transpose eltype must match the type of the Adjoint/Transpose of the input eltype
10-
@test_throws ErrorException Adjoint{Float64,Vector{Int}}(intvec)
11-
@test_throws ErrorException Adjoint{Float64,Matrix{Int}}(intmat)
12-
@test_throws ErrorException Transpose{Float64,Vector{Int}}(intvec)
13-
@test_throws ErrorException Transpose{Float64,Matrix{Int}}(intmat)
10+
@test_throws TypeError Adjoint{Float64,Vector{Int}}(intvec)[1,1]
11+
@test_throws TypeError Adjoint{Float64,Matrix{Int}}(intmat)[1,1]
12+
@test_throws TypeError Transpose{Float64,Vector{Int}}(intvec)[1,1]
13+
@test_throws TypeError Transpose{Float64,Matrix{Int}}(intmat)[1,1]
1414
# Adjoint/Transpose wrapped array type must match the input array type
15-
@test_throws MethodError Adjoint{Int,Vector{Float64}}(intvec)
16-
@test_throws MethodError Adjoint{Int,Matrix{Float64}}(intmat)
17-
@test_throws MethodError Transpose{Int,Vector{Float64}}(intvec)
18-
@test_throws MethodError Transpose{Int,Matrix{Float64}}(intmat)
15+
@test_throws TypeError Adjoint{Int,Vector{Float64}}(intvec)[1,1]
16+
@test_throws TypeError Adjoint{Int,Matrix{Float64}}(intmat)[1,1]
17+
@test_throws TypeError Transpose{Int,Vector{Float64}}(intvec)[1,1]
18+
@test_throws TypeError Transpose{Int,Matrix{Float64}}(intmat)[1,1]
1919
# Adjoint/Transpose inner constructor basic functionality, concrete scalar eltype
2020
@test (Adjoint{Int,Vector{Int}}(intvec)::Adjoint{Int,Vector{Int}}).parent === intvec
2121
@test (Adjoint{Int,Matrix{Int}}(intmat)::Adjoint{Int,Matrix{Int}}).parent === intmat

0 commit comments

Comments
 (0)