Skip to content

Commit

Permalink
Fix test invalided by JuliaLang#44096
Browse files Browse the repository at this point in the history
It turns out JuliaLang#44096 changes the default promote behavior of `AbstractArray` with the same `ndims`. Thus some Test in `Base` is "skipped" silently.

This PR tries to re-activate them.
  • Loading branch information
N5N3 committed Mar 3, 2022
1 parent 8800a80 commit af4c44a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/test/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Random.seed!(1)
Tridiag = Tridiagonal(rand(elty, 9), rand(elty, 10), rand(elty, 9))
SymTri = SymTridiagonal(rand(elty, 10), rand(elty, 9))

mats = [Diag, BidiagU, BidiagL, Tridiag, SymTri]
mats = Any[Diag, BidiagU, BidiagL, Tridiag, SymTri]
for a in mats
for b in mats
@test a*b Matrix(a)*Matrix(b)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ end
X = convert(Matrix{elty}, [1.0 2.0; 3.0 4.0])
Y = convert(Matrix{elty}, [1.5 2.5; 3.5 4.5])
@test dot(X, Y) == convert(elty, 35.0)
Z = convert(Vector{Matrix{elty}}, [reshape(1:4, 2, 2), fill(1, 2, 2)])
Z = Matrix{elty}[reshape(1:4, 2, 2), fill(1, 2, 2)]
@test dot(Z, Z) == convert(elty, 34.0)
end

Expand Down
6 changes: 3 additions & 3 deletions stdlib/LinearAlgebra/test/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ end
LoBi = Bidiagonal(rand(20,20), :L)
Sym = SymTridiagonal(rand(20), rand(19))
Dense = rand(20, 20)
mats = [UpTri, LoTri, Diag, Tridiag, UpBi, LoBi, Sym, Dense]
mats = Any[UpTri, LoTri, Diag, Tridiag, UpBi, LoBi, Sym, Dense]

for op in (+,-,*)
for A in mats
Expand All @@ -160,7 +160,7 @@ end
diag = 1:5
offdiag = 1:4
uniformscalingmats = [UniformScaling(3), UniformScaling(1.0), UniformScaling(3//5), UniformScaling(ComplexF64(1.3, 3.5))]
mats = [Diagonal(diag), Bidiagonal(diag, offdiag, 'U'), Bidiagonal(diag, offdiag, 'L'), Tridiagonal(offdiag, diag, offdiag), SymTridiagonal(diag, offdiag)]
mats = Any[Diagonal(diag), Bidiagonal(diag, offdiag, 'U'), Bidiagonal(diag, offdiag, 'L'), Tridiagonal(offdiag, diag, offdiag), SymTridiagonal(diag, offdiag)]
for T in [ComplexF64, Int64, Rational{Int64}, Float64]
push!(mats, Diagonal(Vector{T}(diag)))
push!(mats, Bidiagonal(Vector{T}(diag), Vector{T}(offdiag), 'U'))
Expand Down Expand Up @@ -321,7 +321,7 @@ using .Main.Furlongs
Bl = Bidiagonal(rand(elty, 10), rand(elty, 9), 'L')
T = Tridiagonal(rand(elty, 9),rand(elty, 10), rand(elty, 9))
S = SymTridiagonal(rand(elty, 10), rand(elty, 9))
mats = [D, Bu, Bl, T, S]
mats = Any[D, Bu, Bl, T, S]
for A in mats
@test iszero(zero(A))
@test isone(one(A))
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Profile/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end
iobuf = IOBuffer()
with_logger(NullLogger()) do
@testset for format in [:flat, :tree]
@testset for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,2]]
@testset for threads in Any[1:Threads.nthreads(), 1, 1:1, 1:2, [1,2]]
@testset for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]]
Profile.print(iobuf; groupby, threads, format)
@test !isempty(String(take!(iobuf)))
Expand Down
4 changes: 2 additions & 2 deletions test/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,14 @@ test18695(r) = sum( t^2 for t in r )
@test prod(Char['a','b']) == "ab"

@testset "optimized reduce(vcat/hcat, A) for arrays" begin
for args in ([1:2], [[1, 2]], [1:2, 3:4], [[3, 4, 5], 1:2], [1:2, [3.5, 4.5]],
for args in ([1:2], [[1, 2]], [1:2, 3:4], AbstractVector{Int}[[3, 4, 5], 1:2], AbstractVector[1:2, [3.5, 4.5]],
[[1 2], [3 4; 5 6]], [reshape([1, 2], 2, 1), 3:4])
X = reduce(vcat, args)
Y = vcat(args...)
@test X == Y
@test typeof(X) === typeof(Y)
end
for args in ([1:2], [[1, 2]], [1:2, 3:4], [[3, 4, 5], 1:3], [1:2, [3.5, 4.5]],
for args in ([1:2], [[1, 2]], [1:2, 3:4], AbstractVector{Int}[[3, 4, 5], 1:3], AbstractVector[1:2, [3.5, 4.5]],
[[1 2; 3 4], [5 6; 7 8]], [1:2, [5 6; 7 8]], [[5 6; 7 8], [1, 2]])
X = reduce(hcat, args)
Y = hcat(args...)
Expand Down

0 comments on commit af4c44a

Please sign in to comment.