(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestExpressionSlicePool(t *testing.T) { |
| 156 | // Test getting an expression slice |
| 157 | slice1 := GetExpressionSlice() |
| 158 | if slice1 == nil { |
| 159 | t.Fatal("expected non-nil slice") |
| 160 | } |
| 161 | *slice1 = append(*slice1, &Identifier{Name: "test"}) |
| 162 | |
| 163 | // Release back to pool |
| 164 | PutExpressionSlice(slice1) |
| 165 | |
| 166 | // Test getting another slice reuses the pool |
| 167 | slice2 := GetExpressionSlice() |
| 168 | if slice2 == nil { |
| 169 | t.Fatal("expected non-nil slice") |
| 170 | } |
| 171 | if len(*slice2) != 0 { |
| 172 | t.Errorf("expected empty slice after reset, got len %d", len(*slice2)) |
| 173 | } |
| 174 | PutExpressionSlice(slice2) |
| 175 | } |
| 176 | |
| 177 | func TestPutExpression(t *testing.T) { |
| 178 | // Test putting nil expression |
nothing calls this directly
no test coverage detected