Skip to content

Commit

Permalink
test: add unit test for rule: check column comment
Browse files Browse the repository at this point in the history
  • Loading branch information
winfredLIN committed Dec 3, 2024
1 parent b5eca75 commit 28fc842
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sqle/driver/mysql/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,13 @@ ALTER TABLE exist_db.exist_tb_1 CHANGE COLUMN v2 v3 varchar(255) NOT NULL DEFAUL
`,
newTestResult().addResult(rulepkg.DDLCheckColumnWithoutComment),
)

runSingleRuleInspectCase(rule, t, "alter_table: column without comment(1)", DefaultMysqlInspect(),
`
ALTER TABLE exist_db.exist_tb_1 MODIFY COLUMN v3 varchar(500) NOT NULL DEFAULT "modified unit test";
`,
newTestResult().addResult(rulepkg.DDLCheckColumnWithoutComment),
)
}

func TestCheckIndexPrefix(t *testing.T) {
Expand Down

0 comments on commit 28fc842

Please sign in to comment.