Skip to content

Commit e0d5217

Browse files
fix: test expectation
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
1 parent 6057421 commit e0d5217

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

go/mysql/result_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ limitations under the License.
1717
package mysql
1818

1919
import (
20-
"fmt"
2120
"testing"
2221

2322
"github.com/stretchr/testify/assert"
2423
"github.com/stretchr/testify/require"
2524

25+
cmp "vitess.io/vitess/go/test/utils"
2626
querypb "vitess.io/vitess/go/vt/proto/query"
2727
)
2828

@@ -56,7 +56,11 @@ func TestParseResult(t *testing.T) {
5656
er := &querypb.ExecuteResponse{RawPackets: packets}
5757
qr, err := ParseResult(er, true)
5858
require.NoError(t, err)
59-
assert.EqualValues(t, `[name:"Tables_in_vt_ks" type:VARCHAR table:"TABLES" org_name:"Tables_in_vt_ks" column_length:256 charset:255]`, fmt.Sprintf("%v", qr.Fields))
59+
60+
// validations
61+
assert.EqualValues(t, 1, len(qr.Fields))
62+
exp := &querypb.Field{Name: "Tables_in_vt_ks", Type: querypb.Type_VARCHAR, Table: "TABLES", OrgName: "Tables_in_vt_ks", ColumnLength: 256, Charset: 255}
63+
cmp.MustMatch(t, exp, qr.Fields[0])
6064
assert.EqualValues(t, 21, len(qr.Rows))
6165
assert.EqualValues(t, 0, qr.RowsAffected)
6266
assert.EqualValues(t, 0, qr.InsertID)

0 commit comments

Comments
 (0)