@@ -336,7 +336,11 @@ func TestVarVector_Eq2(t *testing.T) {
336336
337337 // Verify that constraint can be created with no issues.
338338 _ , err := vv1 .Eq (badRHS )
339- expectedError := fmt .Sprintf ("The Eq() method for VarVector is not implemented yet for type %T!" , badRHS )
339+ expectedError := fmt .Sprintf (
340+ "The VarVector.Comparison (%v) method is not implemented yet for type %T!" ,
341+ optim .SenseEqual ,
342+ badRHS ,
343+ )
340344 if ! strings .Contains (err .Error (), expectedError ) {
341345 t .Errorf ("Expected error \" %v\" ; received \" %v\" " , expectedError , err )
342346 }
@@ -1066,16 +1070,22 @@ func TestVarVector_GreaterEq1(t *testing.T) {
10661070
10671071 // Compare
10681072 _ , err := vec1 .GreaterEq (kv1 )
1069- if ! strings .Contains (
1070- err .Error (),
1071- fmt .Sprintf (
1072- "The two inputs to comparison '%v' must have the same dimension, but #1 has dimension %v and #2 has dimension %v!" ,
1073- optim .SenseGreaterThanEqual ,
1074- vec1 .Len (),
1075- kv1 .Len (),
1076- ),
1077- ) {
1078- t .Errorf ("Unexpected error when comparing two vectors: %v" , err )
1073+ expectedError := fmt .Sprintf (
1074+ "The two inputs to comparison '%v' must have the same dimension, but #1 has dimension %v and #2 has dimension %v!" ,
1075+ optim .ConstrSense (optim .SenseGreaterThanEqual ),
1076+ vec1 .Len (),
1077+ kv1 .Len (),
1078+ )
1079+ if err == nil {
1080+ t .Errorf ("No error was thrown, but we expected one!" )
1081+ } else {
1082+ if ! strings .Contains (
1083+ err .Error (),
1084+ expectedError ,
1085+ ) {
1086+ t .Errorf ("Unexpected error when comparing two vectors: %v \n expected %v" , err , expectedError )
1087+ }
1088+
10791089 }
10801090
10811091}
0 commit comments