@@ -9,7 +9,8 @@ module TestLP
99using Test
1010
1111import MathOptInterface as MOI
12- const LP = MOI. FileFormats. LP
12+ import MathOptInterface. FileFormats: LP
13+
1314const LP_TEST_FILE = " test.lp"
1415
1516function test_show ()
@@ -464,7 +465,8 @@ function test_read_example_lo1()
464465 @test (MOI. ScalarAffineFunction{Float64}, MOI. LessThan{Float64}) in
465466 constraints
466467 @test (MOI. VariableIndex, MOI. GreaterThan{Float64}) in constraints
467- @test (MOI. VariableIndex, MOI. Interval{Float64}) in constraints
468+ @test (MOI. VariableIndex, MOI. LessThan{Float64}) in constraints
469+ @test ! ((MOI. VariableIndex, MOI. Interval{Float64}) in constraints)
468470 io = IOBuffer ()
469471 write (io, model)
470472 seekstart (io)
@@ -525,7 +527,8 @@ function test_read_model1()
525527 @test (MOI. ScalarAffineFunction{Float64}, MOI. LessThan{Float64}) in
526528 constraints
527529 @test (MOI. VariableIndex, MOI. GreaterThan{Float64}) in constraints
528- @test (MOI. VariableIndex, MOI. Interval{Float64}) in constraints
530+ @test (MOI. VariableIndex, MOI. LessThan{Float64}) in constraints
531+ @test ! ((MOI. VariableIndex, MOI. Interval{Float64}) in constraints)
529532 @test (MOI. VariableIndex, MOI. Integer) in constraints
530533 @test (MOI. VariableIndex, MOI. ZeroOne) in constraints
531534 @test (MOI. VectorOfVariables, MOI. SOS1{Float64}) in constraints
@@ -543,9 +546,17 @@ function test_read_model2()
543546 @test (MOI. ScalarAffineFunction{Float64}, MOI. LessThan{Float64}) in
544547 constraints
545548 @test (MOI. VariableIndex, MOI. GreaterThan{Float64}) in constraints
546- @test (MOI. VariableIndex, MOI. Interval{Float64}) in constraints
549+ @test (MOI. VariableIndex, MOI. LessThan{Float64}) in constraints
550+ @test ! ((MOI. VariableIndex, MOI. Interval{Float64}) in constraints)
547551 @test (MOI. VariableIndex, MOI. Integer) in constraints
548552 @test (MOI. VariableIndex, MOI. ZeroOne) in constraints
553+ @test MOI. get (model, MOI. VariableName (), MOI. VariableIndex (2 )) == " V5"
554+ ci = MOI. ConstraintIndex {MOI.VariableIndex,MOI.LessThan{Float64}} (2 )
555+ @test MOI. get (model, MOI. ConstraintSet (), ci) == MOI. LessThan (1.0 )
556+ ci = MOI. ConstraintIndex {MOI.VariableIndex,MOI.GreaterThan{Float64}} (2 )
557+ @test MOI. get (model, MOI. ConstraintSet (), ci) == MOI. GreaterThan (0.0 )
558+ ci = MOI. ConstraintIndex {MOI.VariableIndex,MOI.Interval{Float64}} (2 )
559+ @test ! MOI. is_valid (model, ci)
549560 @test MOI. get (model, MOI. VariableName (), MOI. VariableIndex (8 )) == " V8"
550561 @test model. variables. lower[8 ] == - Inf
551562 @test model. variables. upper[8 ] == - 3
0 commit comments