2024-08-09 19:14:28 +00:00
|
|
|
package builder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestConvertConflict(t *testing.T) {
|
2024-08-15 07:06:11 +00:00
|
|
|
ctx := CommonDialect{
|
2024-08-09 19:14:28 +00:00
|
|
|
TableName: "test",
|
|
|
|
TableAlias: "t",
|
|
|
|
FieldName: "test",
|
|
|
|
}
|
2024-08-09 22:33:10 +00:00
|
|
|
result := convertConflict(ctx, "a", "b", "tb.c")
|
2024-08-09 19:14:28 +00:00
|
|
|
|
2024-08-09 22:33:10 +00:00
|
|
|
if result != `ON CONFLICT (t.a,t.b,tb.c)` {
|
|
|
|
t.Errorf(`Expected "ON CONFLICT (t.a,t.b,tb.c)", got %s`, result)
|
2024-08-09 19:14:28 +00:00
|
|
|
}
|
|
|
|
}
|