MCPcopy
hub / github.com/kenn-io/msgvault / TestDuckDBEngine_AggregateByRecipient

Function TestDuckDBEngine_AggregateByRecipient

internal/query/duckdb_test.go:422–435  ·  view source on GitHub ↗

TestDuckDBEngine_AggregateByRecipient verifies that recipient aggregation includes both to and cc recipients using list_concat.

(t *testing.T)

Source from the content-addressed store, hash-verified

420// TestDuckDBEngine_AggregateByRecipient verifies that recipient aggregation
421// includes both to and cc recipients using list_concat.
422func TestDuckDBEngine_AggregateByRecipient(t *testing.T) {
423 engine := newParquetEngine(t)
424 ctx := context.Background()
425 results, err := engine.Aggregate(ctx, ViewRecipients, DefaultAggregateOptions())
426 requirepkg.NoError(t, err, "AggregateByRecipient")
427
428 // Expected recipients from test data (includes cc):
429 assertAggregateCounts(t, results, map[string]int64{
430 "bob@company.org": 3, // to in msgs 1,2,3
431 "carol@example.com": 1, // to in msg 1
432 "alice@example.com": 2, // to in msgs 4,5
433 "dan@other.net": 1, // cc in msg 2
434 })
435}
436
437// TestDuckDBEngine_AggregateByRecipient_SearchFiltersOnKey verifies that
438// text term search in Recipients view matches subjects, senders, and the

Callers

nothing calls this directly

Calls 5

newParquetEngineFunction · 0.85
DefaultAggregateOptionsFunction · 0.85
assertAggregateCountsFunction · 0.85
NoErrorMethod · 0.80
AggregateMethod · 0.65

Tested by

no test coverage detected