Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 9, 2024
1 parent 1cd6d18 commit 924b4ca
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions test/test_utilities.jl
Expand Up @@ -771,19 +771,6 @@ mutable struct DictVector{T} <: Convex.AbstractVariable
)
return this
end

@testset "test_write_to_file" begin
x = Variable(3)
p = minimize(logsumexp(x))
dir = mktempdir()
filename = joinpath(dir, "test.mof.json")
@test_throws ArgumentError write_to_file(p, filename)
solve!(p, SCS.Optimizer; silent_solver = true)
write_to_file(p, filename)
@test occursin("ExponentialCone", read(filename, String))
p_int = minimize(logsumexp(x); numeric_type = Int)
@test_throws MethodError write_to_file(p_int, filename)
end
end

Convex.evaluate(x::DictVector) = global_cache[x.id_hash][:value]
Expand Down Expand Up @@ -935,6 +922,20 @@ function test_ProbabilityVectors()
return
end

function test_write_to_file()
x = Variable(3)
p = minimize(logsumexp(x))
dir = mktempdir()
filename = joinpath(dir, "test.mof.json")
@test_throws ArgumentError write_to_file(p, filename)
solve!(p, SCS.Optimizer; silent_solver = true)
write_to_file(p, filename)
@test occursin("ExponentialCone", read(filename, String))
p_int = minimize(logsumexp(x); numeric_type = Int)
@test_throws MethodError write_to_file(p_int, filename)
return
end

end # TestUtilities

TestUtilities.runtests()

0 comments on commit 924b4ca

Please sign in to comment.