diff --git a/test/caching_allocations.jl b/test/caching_allocations.jl index 862ec22..c45af14 100644 --- a/test/caching_allocations.jl +++ b/test/caching_allocations.jl @@ -31,10 +31,10 @@ end @test Y isa AlgebraElement - @static if v"1.10" ≤ VERSION < v"1.11" + @static if v"1.10" ≤ VERSION star(Y) star(Y) - @test (@allocations star(Y)) ≤ 4 + @test (@allocations star(Y)) ≤ 6 end @test SA.supp(Y) == basis(fRG)[1:k] @@ -48,7 +48,7 @@ end @test all(!iszero(mstr.table)) @test_throws SA.UndefRefError all(!iszero, SA.mstructure(fRG).table) - @static if v"1.10" ≤ VERSION < v"1.11" + @static if v"1.10" ≤ VERSION @test (@allocations Y * Y) > k^2 - 2 * k @test Y * Y isa AlgebraElement @test (@allocations Y * Y) ≤ 26 @@ -63,15 +63,15 @@ end @test all(!iszero, SA.mstructure(fRG).table) - @static if v"1.10" ≤ VERSION < v"1.11" + @static if v"1.10" ≤ VERSION YY = deepcopy(Y) _alloc_test(YY, *, Y, Y, 25) _alloc_test(YY, +, Y, Y, 0) _alloc_test(YY, -, Y, Y, 0) # SparseArrays calls `Base.unalias` which allocates: - _alloc_test(YY, +, YY, Y, 2) - _alloc_test(YY, +, Y, YY, 2) + _alloc_test(YY, +, YY, Y, 4) + _alloc_test(YY, +, Y, YY, 4) end end diff --git a/test/monoid_algebra.jl b/test/monoid_algebra.jl index a05f9d2..97b951e 100644 --- a/test/monoid_algebra.jl +++ b/test/monoid_algebra.jl @@ -127,12 +127,13 @@ @test_throws ArgumentError MA.operate_to!(d, *, d, b) d = deepcopy(a) - @test @allocated(MA.operate_to!(d, *, 2, d)) == 0 - @test d == 2a - + MA.operate_to!(d, *, 2, a) # preallocates memory in coefficients @test @allocated(MA.operate_to!(d, *, 2, a)) == 0 @test d == 2a + @test @allocated(MA.operate_to!(d, *, 2, d)) == 0 + @test d == 4a + MA.operate_to!(d, *, a, b, 2) @test d == 2 * a * b end