Skip to content

Commit b4890c0

Browse files
committed
Add matrix element-wise print tests
1 parent b751e33 commit b4890c0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/StdTest.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ end
133133
@test to_std_string(contract(D, C)) == "DᵀCᵀ"
134134
end
135135

136+
@testset "to_std_string output is correct with matrix-matrix element wise multiplication" begin
137+
A = Monomial("A", Upper(1), Lower(2))
138+
B = Monomial("B", Upper(1), Lower(2))
139+
140+
@test to_std_string(A .* B) == "A ⊙ B"
141+
@test to_std_string(A .* A) == "A ⊙ A"
142+
@test to_std_string(dc.evaluate(A * (A .* B))) == "A(A ⊙ B)"
143+
@test to_std_string(dc.evaluate((A .* B) * A)) == "(A ⊙ B)A"
144+
@test to_std_string(dc.evaluate(A .* (A * B))) == "AB ⊙ A"
145+
@test to_std_string(dc.evaluate((A * B) .* A)) == "AB ⊙ A"
146+
end
147+
136148
@testset "to_std_string output is correct with matrix-matrix sum" begin
137149
A = Monomial("A", Upper(1), Lower(2))
138150
B = Monomial("B", Upper(1), Lower(2))

0 commit comments

Comments
 (0)