File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1051,6 +1051,32 @@ function test_start_value_nothing(ModelType, ::Any)
1051
1051
return
1052
1052
end
1053
1053
1054
+ function test_Model_VariableRef (:: Any , :: Any )
1055
+ model = Model ()
1056
+ x = VariableRef (model)
1057
+ @test x isa VariableRef
1058
+ @test name (x) == " "
1059
+ @test num_variables (model) == 1
1060
+ return
1061
+ end
1062
+
1063
+ function test_Model_VariableIndex_VariableRef (:: Any , :: Any )
1064
+ model = Model ()
1065
+ @variable (model, x)
1066
+ @test MOI. VariableIndex (x) === index (x)
1067
+ return
1068
+ end
1069
+
1070
+ function test_Model_VariableIndex_VariableRef_fix_with_upper_bound (:: Any , :: Any )
1071
+ model = Model ()
1072
+ @variable (model, x <= 2 )
1073
+ fix (x, 1.0 ; force = true )
1074
+ @test is_fixed (x)
1075
+ @test fix_value (x) == 1.0
1076
+ @test ! has_upper_bound (x)
1077
+ return
1078
+ end
1079
+
1054
1080
function runtests ()
1055
1081
for name in names (@__MODULE__ ; all = true )
1056
1082
if ! startswith (" $(name) " , " test_" )
You can’t perform that action at this time.
0 commit comments