MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestQuery_Len

Function TestQuery_Len

backend/common/qb/qb_test.go:450–467  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

448}
449
450func TestQuery_Len(t *testing.T) {
451 // Test Len() method
452 q := Q()
453 require.Equal(t, 0, q.Len())
454
455 q.Space("SELECT * FROM users")
456 require.Equal(t, 1, q.Len())
457
458 q.Where("id = ?", 123)
459 require.Equal(t, 2, q.Len())
460
461 q.And("active = ?", true)
462 require.Equal(t, 3, q.Len())
463
464 // Nil query
465 var nilQ *Query
466 require.Equal(t, 0, nilQ.Len())
467}
468
469func TestQuery_DeeplyNestedComposition(t *testing.T) {
470 // Test 3+ levels of nested queries

Callers

nothing calls this directly

Calls 6

LenMethod · 0.95
QFunction · 0.85
SpaceMethod · 0.80
WhereMethod · 0.80
AndMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected