Skip to content

Commit e5f7b6b

Browse files
Additional test
1 parent 3bb89a2 commit e5f7b6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

go/base/utils_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ func TestValidateConnection(t *testing.T) {
8686
}
8787
test.S(t).ExpectNil(ValidateConnection(serverInfo, connectionConfig, migrationContext, "test"))
8888
}
89+
// check validation fails when port does not match connectionConfig
90+
{
91+
migrationContext := &MigrationContext{Log: NewDefaultLogger()}
92+
serverInfo := &mysql.ServerInfo{
93+
Port: gosql.NullInt64{Int64: 9999, Valid: true},
94+
}
95+
test.S(t).ExpectNotNil(ValidateConnection(serverInfo, connectionConfig, migrationContext, "test"))
96+
}
8997
// check validation fails when port and extra_port are invalid
9098
{
9199
migrationContext := &MigrationContext{Log: NewDefaultLogger()}

0 commit comments

Comments
 (0)