dal/pkg/builder/convert_conflict_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

19 lines
339 B
Go

package builder
import (
"testing"
)
func TestConvertConflict(t *testing.T) {
ctx := CommonDialect{
TableName: "test",
TableAlias: "t",
FieldName: "test",
}
result := convertConflict(ctx, "a", "b", "tb.c")
if result != `ON CONFLICT (t.a,t.b,tb.c)` {
t.Errorf(`Expected "ON CONFLICT (t.a,t.b,tb.c)", got %s`, result)
}
}