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

Function TestRenderBetween

pkg/formatter/render_test.go:905–916  ·  view source on GitHub ↗

─── BETWEEN expression ──────────────────────────────────────────────────────

(t *testing.T)

Source from the content-addressed store, hash-verified

903// ─── BETWEEN expression ──────────────────────────────────────────────────────
904
905func TestRenderBetween(t *testing.T) {
906 expr := &ast.BetweenExpression{
907 Expr: &ast.Identifier{Name: "age"},
908 Lower: &ast.LiteralValue{Value: "18"},
909 Upper: &ast.LiteralValue{Value: "65"},
910 }
911 result := fmtExpr(expr, ast.ReadableStyle())
912 expected := "age BETWEEN 18 AND 65"
913 if result != expected {
914 t.Errorf("expected %q, got %q", expected, result)
915 }
916}
917
918func TestRenderBetween_Not(t *testing.T) {
919 expr := &ast.BetweenExpression{

Callers

nothing calls this directly

Calls 3

ReadableStyleFunction · 0.92
fmtExprFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected