MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestDropStatement_SQL

Function TestDropStatement_SQL

pkg/sql/ast/sql_coverage_test.go:60–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

58}
59
60func TestDropStatement_SQL(t *testing.T) {
61 stmt := &DropStatement{
62 ObjectType: "TABLE",
63 IfExists: true,
64 Names: []string{"users", "orders"},
65 CascadeType: "CASCADE",
66 }
67 sql := stmt.SQL()
68 for _, want := range []string{"DROP TABLE", "IF EXISTS", "users, orders", "CASCADE"} {
69 if !strings.Contains(sql, want) {
70 t.Errorf("SQL() missing %q, got: %s", want, sql)
71 }
72 }
73}
74
75func TestTruncateStatement_SQL(t *testing.T) {
76 stmt := &TruncateStatement{Tables: []string{"users"}, RestartIdentity: true, CascadeType: "CASCADE"}

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected