dal/pkg/builder/convert_update_test.go
Anton Nesterov 7f5c2a32cc
[ref] refactor adapter, add dialect registry for future extensibility
Signed-off-by: Anton Nesterov <anton@demiurg.io>
2024-08-15 09:06:29 +02:00

22 lines
391 B
Go

package builder
import (
"testing"
)
func TestConvertUpdate(t *testing.T) {
ctx := CommonDialect{
TableName: "test",
TableAlias: "t",
FieldName: "test",
}
result := convertUpdate(ctx, Map{
"c": nil,
"a": 1,
"b": 2,
})
if result.Statement != `UPDATE test SET a = ?,b = ?,c = ?` {
t.Errorf(`Expected "UPDATE test SET a = ?,b = ?,c = ?", got %s`, result.Statement)
}
}