Skip to content

Commit c7447c3

Browse files
Improve test
1 parent 39022cf commit c7447c3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

go/logic/inspect_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,25 @@ func TestRequiresBinlogFormatChange(t *testing.T) {
3636
migrationContext := &base.MigrationContext{
3737
InspectorServerInfo: &mysql.ServerInfo{},
3838
}
39-
39+
inspector := &Inspector{migrationContext: migrationContext}
40+
{
41+
migrationContext.InspectorServerInfo.BinlogFormat = "ROW"
42+
test.S(t).ExpectFalse(inspector.RequiresBinlogFormatChange())
43+
}
44+
{
45+
migrationContext.InspectorServerInfo.BinlogFormat = ""
46+
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
47+
}
4048
{
4149
migrationContext.InspectorServerInfo.BinlogFormat = "MINIMAL"
42-
inspector := &Inspector{migrationContext: migrationContext}
4350
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
4451
}
4552
{
4653
migrationContext.InspectorServerInfo.BinlogFormat = "MIXED"
47-
inspector := &Inspector{migrationContext: migrationContext}
4854
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
4955
}
5056
{
51-
migrationContext.InspectorServerInfo.BinlogFormat = "ROW"
52-
inspector := &Inspector{migrationContext: migrationContext}
53-
test.S(t).ExpectFalse(inspector.RequiresBinlogFormatChange())
57+
migrationContext.InspectorServerInfo = nil
58+
test.S(t).ExpectTrue(inspector.RequiresBinlogFormatChange())
5459
}
5560
}

0 commit comments

Comments
 (0)