20 lines
473 B
Go
20 lines
473 B
Go
package clickhouse
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestInsertSQL 验证语句构造(S1-B:标识符反引号化,兼容含连字符表名)。
|
|
func TestInsertSQL(t *testing.T) {
|
|
if got := insertSQL("mt", []string{"id", "mobile"}); got != "INSERT INTO `mt` (`id`,`mobile`)" {
|
|
t.Errorf("insertSQL = %q", got)
|
|
}
|
|
}
|
|
|
|
// TestOpenValidation 验证配置校验。
|
|
func TestOpenValidation(t *testing.T) {
|
|
if _, err := Open(Config{}); err == nil {
|
|
t.Error("空 addrs 应报错")
|
|
}
|
|
}
|