From 4b09232e84f3a5cd34d164bcc21d77f5f2500168 Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 1 Mar 2024 09:00:44 +1300 Subject: [PATCH] Add Test --- test/dispatch.jl | 8 ++++++++ test/dummy.jl | 2 ++ 2 files changed, 10 insertions(+) diff --git a/test/dispatch.jl b/test/dispatch.jl index 5856459c..11d5bcfc 100644 --- a/test/dispatch.jl +++ b/test/dispatch.jl @@ -55,3 +55,11 @@ end @test all(MA.isequal_canonical.(2 * LinearAlgebra.Hermitian(A, :L), D)) @test all(MA.isequal_canonical.(2 * LinearAlgebra.Hermitian(A, :U), D)) end + +@testset "*(::Complex, ::Hermitian)" begin + A = [1 2; 2 3] + B = LinearAlgebra.Hermitian(DummyBigInt.(A)) + C = 2im * A + @test 2im * B == C + @test C isa Matrix{Complex{BigInt}} +end diff --git a/test/dummy.jl b/test/dummy.jl index c84e55bb..2121661c 100644 --- a/test/dummy.jl +++ b/test/dummy.jl @@ -171,3 +171,5 @@ end function Base.:^(x::DummyBigInt, y::Union{Integer,UniformScaling{<:Integer}}) return DummyBigInt(x.data^y) end + +Base.:*(x::Complex, y::DummyBigInt) = x * y.data