Skip to content

Commit

Permalink
fix: test expectation
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Nov 15, 2024
1 parent 6057421 commit e0d5217
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions go/mysql/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ limitations under the License.
package mysql

import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

cmp "vitess.io/vitess/go/test/utils"
querypb "vitess.io/vitess/go/vt/proto/query"
)

Expand Down Expand Up @@ -56,7 +56,11 @@ func TestParseResult(t *testing.T) {
er := &querypb.ExecuteResponse{RawPackets: packets}
qr, err := ParseResult(er, true)
require.NoError(t, err)
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))

// validations
assert.EqualValues(t, 1, len(qr.Fields))
exp := &querypb.Field{Name: "Tables_in_vt_ks", Type: querypb.Type_VARCHAR, Table: "TABLES", OrgName: "Tables_in_vt_ks", ColumnLength: 256, Charset: 255}
cmp.MustMatch(t, exp, qr.Fields[0])
assert.EqualValues(t, 21, len(qr.Rows))
assert.EqualValues(t, 0, qr.RowsAffected)
assert.EqualValues(t, 0, qr.InsertID)
Expand Down

0 comments on commit e0d5217

Please sign in to comment.