From 5952d725c7058a3780d12da7049a53728831cc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 14 Jun 2024 10:41:27 +0200 Subject: [PATCH] Add test --- src/arithmetic.jl | 5 ----- test/monoid_algebra.jl | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/arithmetic.jl b/src/arithmetic.jl index 2a45339..b2f078e 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -133,8 +133,3 @@ function unsafe_push!(a::SparseArrays.SparseVector, k, v) a[k] = MA.add!!(a[k], v) return a end - -function unsafe_push!(a::AlgebraElement, k, v) - unsafe_push!(coeffs(a), basis(a)[k], v) - return a -end diff --git a/test/monoid_algebra.jl b/test/monoid_algebra.jl index 92f376c..a49f738 100644 --- a/test/monoid_algebra.jl +++ b/test/monoid_algebra.jl @@ -132,6 +132,12 @@ @test @allocated(MA.operate_to!(d, *, a, 2)) == 0 @test d == 2a + + MA.operate!(zero, d) + MA.operate!(SA.UnsafeAddMul(*), d, a, b, b) + MA.operate!(SA.canonical, SA.coeffs(d)) + @test a * b^2 == *(a, b, b) + @test d == *(a, b, b) end end end