Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
timvaillancourt committed Dec 13, 2022
1 parent 39022cf commit c7447c3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions go/logic/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ func TestRequiresBinlogFormatChange(t *testing.T) {
migrationContext := &base.MigrationContext{
InspectorServerInfo: &mysql.ServerInfo{},
}

inspector := &Inspector{migrationContext: migrationContext}
{
migrationContext.InspectorServerInfo.BinlogFormat = "ROW"
test.S(t).ExpectFalse(inspector.RequiresBinlogFormatChange())
}
{
migrationContext.InspectorServerInfo.BinlogFormat = ""
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
}
{
migrationContext.InspectorServerInfo.BinlogFormat = "MINIMAL"
inspector := &Inspector{migrationContext: migrationContext}
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
}
{
migrationContext.InspectorServerInfo.BinlogFormat = "MIXED"
inspector := &Inspector{migrationContext: migrationContext}
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
}
{
migrationContext.InspectorServerInfo.BinlogFormat = "ROW"
inspector := &Inspector{migrationContext: migrationContext}
test.S(t).ExpectFalse(inspector.RequiresBinlogFormatChange())
migrationContext.InspectorServerInfo = nil
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
}
}

0 comments on commit c7447c3

Please sign in to comment.