diff --git a/go/logic/inspect_test.go b/go/logic/inspect_test.go index ba0acb2a5..50d6e9714 100644 --- a/go/logic/inspect_test.go +++ b/go/logic/inspect_test.go @@ -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()) } }