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

Function TestDropSequenceStatement_ToSQL

pkg/sql/ast/ast_sequence_test.go:86–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestDropSequenceStatement_ToSQL(t *testing.T) {
87 tests := []struct {
88 name string
89 stmt *ast.DropSequenceStatement
90 want string
91 }{
92 {
93 name: "basic",
94 stmt: &ast.DropSequenceStatement{Name: &ast.Identifier{Name: "seq_orders"}},
95 want: "DROP SEQUENCE seq_orders",
96 },
97 {
98 name: "if exists",
99 stmt: &ast.DropSequenceStatement{Name: &ast.Identifier{Name: "seq_orders"}, IfExists: true},
100 want: "DROP SEQUENCE IF EXISTS seq_orders",
101 },
102 {
103 name: "nil name does not panic",
104 stmt: &ast.DropSequenceStatement{},
105 want: "DROP SEQUENCE ",
106 },
107 }
108 for _, tt := range tests {
109 t.Run(tt.name, func(t *testing.T) {
110 got := tt.stmt.ToSQL()
111 if got != tt.want {
112 t.Errorf("ToSQL() = %q, want %q", got, tt.want)
113 }
114 })
115 }
116}
117
118func TestAlterSequenceStatement_ToSQL(t *testing.T) {
119 tests := []struct {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
ErrorfMethod · 0.65
ToSQLMethod · 0.45

Tested by

no test coverage detected