11# TODO : Move generic model tests from MOIU to here
22
3- struct UnknownSet <: MOI.AbstractSet end
3+ struct UnknownScalarSet <: MOI.AbstractScalarSet end
4+ struct UnknownVectorSet <: MOI.AbstractVectorSet end
45
56function nametest (model:: MOI.ModelLike )
67 @testset " Name test" begin
@@ -145,9 +146,9 @@ MOI.get(::BadModel, ::MOI.ConstraintSet, ::MOI.ConstraintIndex{MOI.SingleVariabl
145146MOI. get (:: BadModel , :: MOI.ListOfConstraintAttributesSet ) = MOI. AbstractConstraintAttribute[]
146147
147148struct BadConstraintModel <: BadModel end
148- MOI. get (:: BadConstraintModel , :: MOI.ListOfConstraints ) = [(MOI. SingleVariable, MOI. EqualTo{Float64}), (MOI. SingleVariable, UnknownSet )]
149- MOI. get (:: BadModel , :: MOI.ConstraintFunction , :: MOI.ConstraintIndex{MOI.SingleVariable,UnknownSet } ) = MOI. SingleVariable (MOI. VariableIndex (1 ))
150- MOI. get (:: BadModel , :: MOI.ConstraintSet , :: MOI.ConstraintIndex{MOI.SingleVariable,UnknownSet } ) = UnknownSet ()
149+ MOI. get (:: BadConstraintModel , :: MOI.ListOfConstraints ) = [(MOI. SingleVariable, MOI. EqualTo{Float64}), (MOI. SingleVariable, UnknownScalarSet )]
150+ MOI. get (:: BadModel , :: MOI.ConstraintFunction , :: MOI.ConstraintIndex{MOI.SingleVariable,UnknownScalarSet } ) = MOI. SingleVariable (MOI. VariableIndex (1 ))
151+ MOI. get (:: BadModel , :: MOI.ConstraintSet , :: MOI.ConstraintIndex{MOI.SingleVariable,UnknownScalarSet } ) = UnknownScalarSet ()
151152
152153struct UnknownModelAttribute <: MOI.AbstractModelAttribute end
153154struct BadModelAttributeModel <: BadModel end
@@ -165,7 +166,7 @@ MOI.get(::BadConstraintAttributeModel, ::UnknownConstraintAttribute, ::MOI.Const
165166MOI. get (:: BadConstraintAttributeModel , :: MOI.ListOfConstraintAttributesSet ) = MOI. AbstractConstraintAttribute[UnknownConstraintAttribute ()]
166167
167168function failcopytestc (dest:: MOI.ModelLike )
168- @test ! MOI. supports_constraint (dest, MOI. SingleVariable, UnknownSet )
169+ @test ! MOI. supports_constraint (dest, MOI. SingleVariable, UnknownScalarSet )
169170 @test_throws MOI. UnsupportedConstraint MOI. copy_to (dest, BadConstraintModel ())
170171end
171172function failcopytestia (dest:: MOI.ModelLike )
@@ -253,7 +254,7 @@ function supports_constrainttest(model::MOI.ModelLike, ::Type{GoodT}, ::Type{Bad
253254 @test MOI. supports_constraint (model, MOI. VectorOfVariables, MOI. Zeros)
254255 @test ! MOI. supports_constraint (model, MOI. VectorOfVariables, MOI. EqualTo{GoodT}) # vector in scalar
255256 @test ! MOI. supports_constraint (model, MOI. SingleVariable, MOI. Zeros) # scalar in vector
256- @test ! MOI. supports_constraint (model, MOI. VectorOfVariables, UnknownSet ) # set not supported
257+ @test ! MOI. supports_constraint (model, MOI. VectorOfVariables, UnknownVectorSet ) # set not supported
257258end
258259
259260"""
0 commit comments