Test UpdateExpression pool
(t *testing.T)
| 145 | |
| 146 | // Test UpdateExpression pool |
| 147 | func TestUpdateExpressionPool(t *testing.T) { |
| 148 | t.Run("Get and Put", func(t *testing.T) { |
| 149 | // Get from pool |
| 150 | expr := GetUpdateExpression() |
| 151 | if expr == nil { |
| 152 | t.Fatal("GetUpdateExpression() returned nil") |
| 153 | } |
| 154 | |
| 155 | // Use it |
| 156 | expr.Column = &Identifier{Name: "status"} |
| 157 | expr.Value = &LiteralValue{Value: "active"} |
| 158 | |
| 159 | // Return to pool |
| 160 | PutUpdateExpression(expr) |
| 161 | |
| 162 | // Verify it was cleaned |
| 163 | if expr.Column != nil { |
| 164 | t.Errorf("Column not cleared, got %v", expr.Column) |
| 165 | } |
| 166 | if expr.Value != nil { |
| 167 | t.Errorf("Value not cleared, got %v", expr.Value) |
| 168 | } |
| 169 | }) |
| 170 | |
| 171 | t.Run("Put nil expression", func(t *testing.T) { |
| 172 | // Should not panic |
| 173 | PutUpdateExpression(nil) |
| 174 | }) |
| 175 | } |
| 176 | |
| 177 | // Test LiteralValue pool |
| 178 | func TestLiteralValuePool(t *testing.T) { |
nothing calls this directly
no test coverage detected