MCPcopy Create free account
hub / github.com/PostHog/duckgres / formatDifferences

Function formatDifferences

tests/integration/setup_test.go:374–390  ·  view source on GitHub ↗

formatDifferences formats a list of differences for display

(diffs []string)

Source from the content-addressed store, hash-verified

372
373// formatDifferences formats a list of differences for display
374func formatDifferences(diffs []string) string {
375 if len(diffs) == 0 {
376 return "(none)"
377 }
378 result := ""
379 for i, diff := range diffs {
380 if i > 0 {
381 result += "\n "
382 }
383 result += diff
384 if i >= 5 {
385 result += fmt.Sprintf("\n ... and %d more differences", len(diffs)-5)
386 break
387 }
388 }
389 return result
390}
391
392// mustExec executes a statement and fails the test on error
393func mustExec(t *testing.T, db *sql.DB, query string) {

Callers 1

runQueryTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected