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

Function TestPutBinaryExpressionWithContent

pkg/sql/ast/coverage_test.go:621–639  ·  view source on GitHub ↗

TestPutBinaryExpressionWithContent tests returning BinaryExpressions to pool

(t *testing.T)

Source from the content-addressed store, hash-verified

619
620// TestPutBinaryExpressionWithContent tests returning BinaryExpressions to pool
621func TestPutBinaryExpressionWithContent(t *testing.T) {
622 t.Run("binary expression with children", func(t *testing.T) {
623 expr := GetBinaryExpression()
624 expr.Left = &Identifier{Name: "x"}
625 expr.Right = &LiteralValue{Value: 10}
626 expr.Operator = ">"
627 PutBinaryExpression(expr)
628 })
629
630 t.Run("nil binary expression", func(t *testing.T) {
631 PutBinaryExpression(nil) // Should not panic
632 })
633
634 t.Run("binary expression nil children", func(t *testing.T) {
635 expr := GetBinaryExpression()
636 expr.Operator = "="
637 PutBinaryExpression(expr)
638 })
639}
640
641// TestPutExpressionSliceWithContent tests returning expression slices to pool
642func TestPutExpressionSliceWithContent(t *testing.T) {

Callers

nothing calls this directly

Calls 3

GetBinaryExpressionFunction · 0.85
PutBinaryExpressionFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected