File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1451,6 +1451,39 @@ function test_qcmatrix_read_cplex()
14511451 return
14521452end
14531453
1454+ function test_model_Name ()
1455+ model = MPS. Model ()
1456+ MOI. set (model, MOI. Name (), " TestFoo" )
1457+ io = IOBuffer ()
1458+ write (io, model)
1459+ seekstart (io)
1460+ contents = read (io, String)
1461+ @test occursin (" NAME TestFoo" , contents)
1462+ return
1463+ end
1464+
1465+ function test_model_large_integer ()
1466+ model = MPS. Model ()
1467+ x = MOI. add_constrained_variable (model, MOI. GreaterThan (123.0 ))
1468+ io = IOBuffer ()
1469+ write (io, model)
1470+ seekstart (io)
1471+ contents = read (io, String)
1472+ @test occursin (" LO bounds x1 123" , contents)
1473+ return
1474+ end
1475+
1476+ function test_model_not_empty ()
1477+ model = MPS. Model ()
1478+ x = MOI. add_variable (model)
1479+ io = IOBuffer ()
1480+ @test_throws (
1481+ ErrorException (" Cannot read in file because model is not empty." ),
1482+ read! (io, model),
1483+ )
1484+ return
1485+ end
1486+
14541487end # TestMPS
14551488
14561489TestMPS. runtests ()
Original file line number Diff line number Diff line change 1+ * A model with blank lines and comments
12NAME
3+
24OBJSENSE MIN
5+
36ROWS
47 N obj
58 G con1
9+
610COLUMNS
711 MARKER 'MARKER' 'INTORG'
812 x obj 1 con1 1
You can’t perform that action at this time.
0 commit comments