Skip to content

Commit e2c78b8

Browse files
committed
test: restore ambiguous test
Unfortunately, this test has become broken in the interim since it was disabled by 176ef64 / a15fe4b.
1 parent 68afc6e commit e2c78b8

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

test/ambiguous.jl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,29 @@ using Test, LinearAlgebra, SparseArrays, Aqua
5050
end
5151
end
5252

53-
@testset "detect_ambiguities" begin
54-
@test_nowarn detect_ambiguities(SparseArrays; recursive=true, ambiguous_bottom=false)
53+
let ambig = detect_ambiguities(SparseArrays; recursive=true)
54+
@test_broken isempty(ambig)
55+
ambig = Set{Any}(((m1.sig, m2.sig) for (m1, m2) in ambig))
56+
expect = []
57+
push!(expect, (Tuple{typeof(LinearAlgebra.generic_trimatmul!), AbstractVecOrMat, Any, Any, Function, AbstractMatrix, AbstractVecOrMat},
58+
Tuple{typeof(LinearAlgebra.generic_trimatmul!), StridedVecOrMat, Any, Any, Any, Union{Adjoint{var"#s388", var"#s387"}, Transpose{var"#s388", var"#s387"}} where {var"#s388", var"#s387"<:(Union{SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 2, <:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, Tuple{Base.Slice{Base.OneTo{Int}}, I}} where I<:AbstractUnitRange} where {Tv, Ti})}, AbstractVecOrMat}))
59+
push!(expect, (Tuple{typeof(LinearAlgebra.generic_trimatmul!), AbstractVecOrMat, Any, Any, Function, Union{Adjoint{T, S}, Transpose{T, S}} where {T, S}, AbstractVecOrMat},
60+
Tuple{typeof(LinearAlgebra.generic_trimatmul!), StridedVecOrMat, Any, Any, Any, Union{Adjoint{var"#s388", var"#s387"}, Transpose{var"#s388", var"#s387"}} where {var"#s388", var"#s387"<:(Union{SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 2, <:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, Tuple{Base.Slice{Base.OneTo{Int}}, I}} where I<:AbstractUnitRange} where {Tv, Ti})}, AbstractVecOrMat}))
61+
good = true
62+
while !isempty(ambig)
63+
sigs = pop!(ambig)
64+
i = findfirst(==(sigs), expect)
65+
if i === nothing
66+
println(stderr, "push!(expect, (", sigs[1], ", ", sigs[2], "))")
67+
good = false
68+
continue
69+
end
70+
deleteat!(expect, i)
71+
end
72+
@test isempty(expect)
73+
@test good
5574
end
5675

57-
## This was the older version that was disabled
58-
59-
# let ambig = detect_ambiguities(SparseArrays; recursive=true)
60-
# @test isempty(ambig)
61-
# ambig = Set{Any}(((m1.sig, m2.sig) for (m1, m2) in ambig))
62-
# expect = []
63-
# good = true
64-
# while !isempty(ambig)
65-
# sigs = pop!(ambig)
66-
# i = findfirst(==(sigs), expect)
67-
# if i === nothing
68-
# println(stderr, "push!(expect, (", sigs[1], ", ", sigs[2], "))")
69-
# good = false
70-
# continue
71-
# end
72-
# deleteat!(expect, i)
73-
# end
74-
# @test isempty(expect)
75-
# @test good
76-
# end
77-
7876
###
7977
# Now we restore the original env, as promised
8078
empty!(Base.DEPOT_PATH)

0 commit comments

Comments
 (0)