1
0
Fork 0

Fix enum test

This commit is contained in:
Gregory Eremin 2018-11-09 00:20:12 +01:00
parent ced55880ef
commit 858d8a7ebe
2 changed files with 5 additions and 13 deletions

View File

@ -39,8 +39,8 @@ func main() {
} }
off := conf.Offset off := conf.Offset
for i := 0; i < 100; i++ { // for i := 0; i < 100; i++ {
// for { for {
evt, err := reader.ReadEvent() evt, err := reader.ReadEvent()
if err != nil { if err != nil {
log.Fatalf(ctx, "Failed to read event: %v", err) log.Fatalf(ctx, "Failed to read event: %v", err)

View File

@ -56,20 +56,12 @@ func TestEnum(t *testing.T) {
tbl := suite.createTable(mysql.ColumnTypeEnum, "'a', 'b', 'c'", attrNone) tbl := suite.createTable(mysql.ColumnTypeEnum, "'a', 'b', 'c'", attrNone)
defer tbl.drop(t) defer tbl.drop(t)
const (
// TODO: How do I define such a bitmask properly?
bA int64 = 1
bB int64 = 2
bC int64 = 4
)
inputs := map[string]int64{ inputs := map[string]int64{
"": 0, "": 0,
"a": bA, "a": 1,
"b": bB, "b": 2,
"c": bC, "c": 3,
} }
for in, exp := range inputs { for in, exp := range inputs {
t.Run("input "+in, func(t *testing.T) { t.Run("input "+in, func(t *testing.T) {
suite.insertAndCompareExp(t, tbl, in, exp) suite.insertAndCompareExp(t, tbl, in, exp)