dashboard-cdc-worker/internal/storage/placeholders_test.go
2026-07-08 20:03:52 +08:00

26 lines
608 B
Go

package storage
import "testing"
func TestInPlaceholdersUsesScalarList(t *testing.T) {
tests := []struct {
name string
count int
want string
}{
{name: "single", count: 1, want: "(?)"},
{name: "multiple", count: 3, want: "(?,?,?)"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := inPlaceholders(tt.count); got != tt.want {
t.Fatalf("inPlaceholders(%d) = %q, want %q", tt.count, got, tt.want)
}
if got := inStringPlaceholders(tt.count); got != tt.want {
t.Fatalf("inStringPlaceholders(%d) = %q, want %q", tt.count, got, tt.want)
}
})
}
}