@@ -66,7 +66,7 @@ function test_errors_UnsupportedConstraint()
6666 MOI. UnsupportedConstraint,
6767 MOI. add_constraint (model, vi, MOI. EqualTo (0 )),
6868 )
69- msg = """
69+ ret = """
7070 UnsupportedConstraint{
7171 $(MOI. VariableIndex) ,
7272 $(MOI. EqualTo{Int}) ,
@@ -79,7 +79,7 @@ function test_errors_UnsupportedConstraint()
7979 try
8080 MOI. add_constraint (model, vi, MOI. EqualTo (0 ))
8181 catch err
82- @test sprint (showerror, err) == msg
82+ @test sprint (showerror, err) == ret
8383 end
8484 return
8585end
@@ -299,23 +299,23 @@ end
299299
300300function test_errors_ResultIndexBoundsError ()
301301 err = MOI. ResultIndexBoundsError (MOI. VariablePrimal (1 ), 0 )
302- @test sprint (showerror, err) ==
303- """
304- Result index of attribute MathOptInterface.VariablePrimal(1) is out of bounds.
302+ ret = """
303+ Result index of attribute MathOptInterface.VariablePrimal(1) is out of bounds.
305304
306- There are currently 0 solution(s) in the model.
307- """
305+ There are currently 0 solution(s) in the model.
306+ """
307+ @test sprint (showerror, err) == ret
308308 return
309309end
310310
311311function test_errors_ConflictIndexBoundsError ()
312312 err = MOI. ConflictIndexBoundsError (MOI. ConstraintConflictStatus (1 ), 0 )
313- @test sprint (showerror, err) ==
314- """
315- Conflict index of attribute MathOptInterface.ConstraintConflictStatus(1) is out of bounds.
313+ ret = """
314+ Conflict index of attribute MathOptInterface.ConstraintConflictStatus(1) is out of bounds.
316315
317- There are currently 0 conflict(s) in the model.
318- """
316+ There are currently 0 conflict(s) in the model.
317+ """
318+ @test sprint (showerror, err) == ret
319319 return
320320end
321321
@@ -396,13 +396,13 @@ end
396396
397397function test_showerror_InvalidIndex ()
398398 x = MOI. VariableIndex (1 )
399- @test sprint (showerror, MOI. InvalidIndex (x)) ==
400- """
401- The index $x is invalid.
399+ err = """
400+ The index $x is invalid.
402401
403- An index becomes invalid after it has been deleted. Alternatively, this \
404- error might mean that you have re-used the index from a different model.
405- """
402+ An index becomes invalid after it has been deleted. Alternatively, this \
403+ error might mean that you have re-used the index from a different model.
404+ """
405+ @test sprint (showerror, MOI. InvalidIndex (x)) == err
406406 return
407407end
408408
0 commit comments