|
@@ -44,6 +44,16 @@ func TestApiV1OperateParse(t *testing.T) {
|
|
|
t.Fatal("行数据不正确")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ parsed = operateParse(t, parseSqlDelete)
|
|
|
+
|
|
|
+ if parsed["table"].(string) != tableName {
|
|
|
+ t.Fatal("表名不正确")
|
|
|
+ }
|
|
|
+
|
|
|
+ if parsed["where"] != `(((id = 'aaa') AND (name = 'yjp')) AND (age < 100)) AND (describe IN ('yjp',))` {
|
|
|
+ t.Fatal("where不正确")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func TestApiV1Operate(t *testing.T) {
|
|
@@ -72,6 +82,7 @@ func TestApiV1Operate(t *testing.T) {
|
|
|
})
|
|
|
|
|
|
operate(t, fmt.Sprintf(sqlInsertFormat, tablePrefix, id, name, now.Format(time.DateTime), tableNum), keyColumns)
|
|
|
+ operate(t, fmt.Sprintf(sqlDeleteFormat, tablePrefix, id), keyColumns)
|
|
|
}
|
|
|
|
|
|
func autoMigrate(t *testing.T, items []client.AutoMigrateItem) {
|