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

Function TestPutExpressionSliceWithContent

pkg/sql/ast/coverage_test.go:642–658  ·  view source on GitHub ↗

TestPutExpressionSliceWithContent tests returning expression slices to pool

(t *testing.T)

Source from the content-addressed store, hash-verified

640
641// TestPutExpressionSliceWithContent tests returning expression slices to pool
642func TestPutExpressionSliceWithContent(t *testing.T) {
643 t.Run("expression slice with content", func(t *testing.T) {
644 slice := GetExpressionSlice()
645 *slice = append(*slice, &Identifier{Name: "col1"})
646 *slice = append(*slice, &LiteralValue{Value: 42})
647 PutExpressionSlice(slice)
648 })
649
650 t.Run("nil expression slice", func(t *testing.T) {
651 PutExpressionSlice(nil) // Should not panic
652 })
653
654 t.Run("empty expression slice", func(t *testing.T) {
655 slice := GetExpressionSlice()
656 PutExpressionSlice(slice)
657 })
658}
659
660// TestLiteralValuePooling tests LiteralValue pooling
661func TestLiteralValuePooling(t *testing.T) {

Callers

nothing calls this directly

Calls 3

GetExpressionSliceFunction · 0.85
PutExpressionSliceFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected