File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ include (" zeros.jl" )
12include (" flip_sign.jl" )
Original file line number Diff line number Diff line change 1+ using Test
2+
3+ using MathOptInterface
4+ const MOI = MathOptInterface
5+ const MOIT = MathOptInterface. Test
6+ const MOIU = MathOptInterface. Utilities
7+ const MOIB = MathOptInterface. Bridges
8+
9+ include (" ../utilities.jl" )
10+
11+ include (" ../simple_model.jl" )
12+
13+ mock = MOIU. MockOptimizer (SimpleModel {Float64} ())
14+ config = MOIT. TestConfig ()
15+
16+ @testset " NonposToNonneg" begin
17+ bridged_mock = MOIB. Variable. NonposToNonneg {Float64} (mock)
18+
19+ MOIU. set_mock_optimize! (mock,
20+ (mock:: MOIU.MockOptimizer ) -> MOIU. mock_optimize! (
21+ mock, MOI. INFEASIBLE, MOI. INFEASIBLE_POINT,
22+ MOI. INFEASIBILITY_CERTIFICATE)
23+ )
24+ MOIT. lin4test (bridged_mock, config)
25+
26+ @test MOI. get (mock, MOI. NumberOfVariables ()) == 1
27+ @test length (MOI. get (mock, MOI. ListOfVariableIndices ())) == 1
28+ @test first (MOI. get (mock, MOI. ListOfVariableIndices ())). value ≥ 0
29+ @test MOI. get (bridged_mock, MOI. NumberOfVariables ()) == 1
30+ @test MOI. get (bridged_mock, MOI. ListOfVariableIndices ()) == [MOI. VariableIndex (- 1 )]
31+ end
You can’t perform that action at this time.
0 commit comments