Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix test output #1178

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ end
A = Matrix{Float64}(undef, 0, 0)
@test cbrt(A) == A
A = Matrix{Int}(undef, 0, 0)
@test cbrt(A) isa Matrix{Float64}
@test cbrt(A) isa Matrix{Int}
end
end

Expand Down
22 changes: 11 additions & 11 deletions test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1151,19 +1151,19 @@ end
@testset "issue #1147: error messages in matmul" begin
for T in (Int, Float64, ComplexF64)
for f in (identity, Symmetric)
@test_throws "incompatible dimensions for matrix multiplication" f(zeros(T,0,0)) * zeros(T,1,5)
@test_throws "incompatible dimensions for matrix multiplication" f(zeros(T,0,0)) * zeros(T,1)
@test_throws "incompatible dimensions for matrix multiplication" zeros(T,0) * f(zeros(T,2,2))
@test_throws "incompatible dimensions for matrix multiplication" mul!(zeros(T,0,0), zeros(T,5), zeros(T,5))
@test_throws "incompatible dimensions for matrix multiplication" mul!(zeros(T,0,0), f(zeros(T,1,1)), zeros(T,0,0))
@test_throws "incompatible destination size" mul!(zeros(T,0,2), f(zeros(T,1,1)), zeros(T,1,2))
@test_throws "incompatible destination size" mul!(zeros(T,1,0), f(zeros(T,1,1)), zeros(T,1,2))
@test_throws "incompatible destination size" mul!(zeros(T,0,0), f(zeros(T,1,1)), zeros(T,1))
@test_throws "incompatible destination size" mul!(zeros(T,0), f(zeros(T,1,1)), zeros(T,1))
@test_throws DimensionMismatch f(zeros(T,0,0)) * zeros(T,1,5)
@test_throws DimensionMismatch f(zeros(T,0,0)) * zeros(T,1)
@test_throws DimensionMismatch zeros(T,0) * f(zeros(T,2,2))
@test_throws DimensionMismatch mul!(zeros(T,0,0), zeros(T,5), zeros(T,5))
@test_throws DimensionMismatch mul!(zeros(T,0,0), f(zeros(T,1,1)), zeros(T,0,0))
@test_throws DimensionMismatch mul!(zeros(T,0,2), f(zeros(T,1,1)), zeros(T,1,2))
@test_throws DimensionMismatch mul!(zeros(T,1,0), f(zeros(T,1,1)), zeros(T,1,2))
@test_throws DimensionMismatch mul!(zeros(T,0,0), f(zeros(T,1,1)), zeros(T,1))
@test_throws DimensionMismatch mul!(zeros(T,0), f(zeros(T,1,1)), zeros(T,1))
end

@test_throws "expected size: (2, 2)" LinearAlgebra.matmul2x2!(zeros(T,2,2), 'N', 'N', zeros(T,2,3), zeros(T,3,2))
@test_throws "expected size: (2, 2)" LinearAlgebra.matmul2x2!(zeros(T,2,3), 'N', 'N', zeros(T,2,2), zeros(T,2,3))
@test_throws DimensionMismatch LinearAlgebra.matmul2x2!(zeros(T,2,2), 'N', 'N', zeros(T,2,3), zeros(T,3,2))
@test_throws DimensionMismatch LinearAlgebra.matmul2x2!(zeros(T,2,3), 'N', 'N', zeros(T,2,2), zeros(T,2,3))
end
end

Expand Down
8 changes: 4 additions & 4 deletions test/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,12 @@ end
A = UpperTriangular(ones(T,2,2))
B = ones(T,3,3)
C = similar(B)
@test_throws "incompatible dimensions for matrix multiplication" mul!(C, A, B)
@test_throws "incompatible dimensions for matrix multiplication" mul!(C, B, A)
@test_throws DimensionMismatch mul!(C, A, B)
@test_throws DimensionMismatch mul!(C, B, A)
B = Array(A)
C = similar(B, (4,4))
@test_throws "incompatible destination size" mul!(C, A, B)
@test_throws "incompatible destination size" mul!(C, B, A)
@test_throws DimensionMismatch mul!(C, A, B)
@test_throws DimensionMismatch mul!(C, B, A)
end
end

Expand Down
Loading