From 924b4cae3cb6595aa9b9e8f7da2650697ac6e89a Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 9 Jan 2024 15:19:30 +1300 Subject: [PATCH] Fix rebase --- test/test_utilities.jl | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/test/test_utilities.jl b/test/test_utilities.jl index 30ae619a0..197a29e09 100644 --- a/test/test_utilities.jl +++ b/test/test_utilities.jl @@ -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] @@ -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()