diff --git a/tests/special_test.go b/tests/special_test.go index ccdd74d..7fbafcd 100644 --- a/tests/special_test.go +++ b/tests/special_test.go @@ -51,3 +51,28 @@ func TestSet(t *testing.T) { }) } } + +func TestEnum(t *testing.T) { + tbl := suite.createTable(mysql.ColumnTypeEnum, "'a', 'b', 'c'", attrNone) + 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{ + "": 0, + "a": bA, + "b": bB, + "c": bC, + } + + for in, exp := range inputs { + t.Run("input "+in, func(t *testing.T) { + suite.insertAndCompareExp(t, tbl, in, exp) + }) + } +} diff --git a/tests/suite_test.go b/tests/suite_test.go index c4eed22..c768110 100644 --- a/tests/suite_test.go +++ b/tests/suite_test.go @@ -158,6 +158,8 @@ func colTypeSyntax(ct mysql.ColumnType) (typName, attrs string) { case mysql.ColumnTypeSet: return "SET", "" + case mysql.ColumnTypeEnum: + return "ENUM", "" case mysql.ColumnTypeJSON: return "JSON", "" case mysql.ColumnTypeGeometry: