Skip to content

Commit f6cfdc9

Browse files
committed
Add tests
1 parent fe3110b commit f6cfdc9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/mutable_arithmetics.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Test
2+
using MutableArithmetics
3+
using SymbolicUtils
4+
5+
@syms x::Real y::Real
6+
v = repeat([x, y], 10)
7+
s = sum(v, init = 0)
8+
@test s.dict[x] == 10
9+
@test s.dict[y] == 10
10+
@test isequal(s, 10x + 10y) # ????
11+
12+
a = x + y
13+
b = 2x + y
14+
c = add!!(a, b)
15+
@test c.dict[x] == 3
16+
@test c.dict[y] == 2
17+
@test isequal(c, 3x + 2y)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ using Pkg, Test, SafeTestsets
1818
@safetestset "Adjoints" begin include("adjoints.jl") end
1919
@safetestset "Hash Consing" begin include("hash_consing.jl") end
2020
@safetestset "Cache macro" begin include("cache_macro.jl") end
21+
@safetestset "Cache macro" begin include("mutable_arithmetics.jl") end
2122
end
2223
end

0 commit comments

Comments
 (0)