Test AlterColumnOperation
(t *testing.T)
| 18 | |
| 19 | // Test AlterColumnOperation |
| 20 | func TestAlterColumnOperation(t *testing.T) { |
| 21 | tests := []struct { |
| 22 | name string |
| 23 | op AlterColumnOperation |
| 24 | wantString string |
| 25 | }{ |
| 26 | { |
| 27 | name: "SET DEFAULT", |
| 28 | op: AlterColumnSetDefault, |
| 29 | wantString: "SET DEFAULT", |
| 30 | }, |
| 31 | { |
| 32 | name: "DROP DEFAULT", |
| 33 | op: AlterColumnDropDefault, |
| 34 | wantString: "DROP DEFAULT", |
| 35 | }, |
| 36 | { |
| 37 | name: "SET NOT NULL", |
| 38 | op: AlterColumnSetNotNull, |
| 39 | wantString: "SET NOT NULL", |
| 40 | }, |
| 41 | { |
| 42 | name: "DROP NOT NULL", |
| 43 | op: AlterColumnDropNotNull, |
| 44 | wantString: "DROP NOT NULL", |
| 45 | }, |
| 46 | { |
| 47 | name: "Unknown operation", |
| 48 | op: AlterColumnOperation(999), |
| 49 | wantString: "UNKNOWN", |
| 50 | }, |
| 51 | } |
| 52 | |
| 53 | for _, tt := range tests { |
| 54 | t.Run(tt.name, func(t *testing.T) { |
| 55 | // Test TokenLiteral |
| 56 | if got := tt.op.TokenLiteral(); got != tt.wantString { |
| 57 | t.Errorf("AlterColumnOperation.TokenLiteral() = %v, want %v", got, tt.wantString) |
| 58 | } |
| 59 | |
| 60 | // Test Children (should be nil) |
| 61 | if children := tt.op.Children(); children != nil { |
| 62 | t.Errorf("AlterColumnOperation.Children() = %v, want nil", children) |
| 63 | } |
| 64 | }) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | // Test Query |
| 69 | func TestQuery(t *testing.T) { |
nothing calls this directly
no test coverage detected