MCPcopy
hub / github.com/sqldef/sqldef / TestMssqlQuoteIdentifier

Function TestMssqlQuoteIdentifier

database/mssql/database_test.go:10–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestMssqlQuoteIdentifier(t *testing.T) {
11 db := &MssqlDatabase{}
12
13 for _, legacyIgnoreQuotes := range []bool{true, false} {
14 db.SetGeneratorConfig(database.GeneratorConfig{LegacyIgnoreQuotes: legacyIgnoreQuotes})
15 for _, input := range []string{"PK_SystemUser", "SystemUserId", "Date", "has-dash"} {
16 expected := "[" + strings.ReplaceAll(input, "]", "]]") + "]"
17 if got := db.quoteIdentifier(input); got != expected {
18 t.Fatalf("quoteIdentifier(%q) = %q, want %q", input, got, expected)
19 }
20 }
21 }
22}
23
24func TestBuildExportTableDDLCanonicalPrimaryKey(t *testing.T) {
25 db := &MssqlDatabase{}

Callers

nothing calls this directly

Calls 3

SetGeneratorConfigMethod · 0.95
quoteIdentifierMethod · 0.95
FatalfMethod · 0.65

Tested by

no test coverage detected