Skip to content

Commit

Permalink
Fix printing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 2, 2023
1 parent f12692e commit abc9f2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ function test_minus_one_complex_aff_expr()
model = Model()
@variable(model, x)
f = 1.0im * x + 1.0im
@test sprint(show, im * f) == "(-1.0 + 0.0im) x + (-1.0 + 0.0im)"
@test sprint(show, im * f) == "-x - 1"
return
end

Expand All @@ -867,9 +867,9 @@ function test_print_hermitian_psd_cone()
H = Hermitian([x[1] 1im; -1im x[2]])
c = @constraint(model, H in HermitianPSDCone())
@test sprint(io -> show(io, MIME("text/plain"), c)) ==
"[x[1] (0.0 + 1.0im);\n (0.0 - 1.0im) x[2]] $in_sym $(HermitianPSDCone())"
"[x[1] im;\n -im x[2]] $in_sym $(HermitianPSDCone())"
@test sprint(io -> show(io, MIME("text/latex"), c)) ==
"\$\$ \\begin{bmatrix}\nx_{1} & (0.0 + 1.0im)\\\\\n(0.0 - 1.0im) & x_{2}\\\\\n\\end{bmatrix} \\in \\text{$(HermitianPSDCone())} \$\$"
"\$\$ \\begin{bmatrix}\nx_{1} & im\\\\\n-im & x_{2}\\\\\n\\end{bmatrix} \\in \\text{$(HermitianPSDCone())} \$\$"
return
end

Expand Down

0 comments on commit abc9f2e

Please sign in to comment.