diff --git a/src/Factor.jl b/src/Factor.jl index 241b648ec4..7d7ec7be74 100644 --- a/src/Factor.jl +++ b/src/Factor.jl @@ -56,6 +56,10 @@ _is_legal(a::Fac) = xor(isdefined(a, :fac), isdefined(a, :arr)) _is_dic(a::Fac) = _is_legal(a) && isdefined(a, :fac) +function Base.:(==)(F1::Fac, F2::Fac) + error("Equality testing of factorizations is not supported") +end + @doc raw""" unit(a::Fac{T}) -> T diff --git a/test/Factor-test.jl b/test/Factor-test.jl index a2582744b5..d154dbffcd 100644 --- a/test/Factor-test.jl +++ b/test/Factor-test.jl @@ -29,3 +29,12 @@ end @test string(f) == "x * (x + y) * (x*y)" || string(f) == "x * (x*y) * (x + y)" end + +@testset "Fac.equality" begin + # 2025-10-20 equality test on factorizations always gives error (even if the args are ===) + f = Fac(-1, Dict{Int, Int}(2 => 3, 3 => 1)) + ff = Fac(-1, [2 => 3, 3 => 1]) + + @test_throws ErrorException f == f + @test_throws ErrorException (f == ff) +end