BenchmarkOffsetToLineColumn benchmarks offset to line/column conversion
(b *testing.B)
| 495 | |
| 496 | // BenchmarkOffsetToLineColumn benchmarks offset to line/column conversion |
| 497 | func BenchmarkOffsetToLineColumn(b *testing.B) { |
| 498 | content := `SELECT id, name, email |
| 499 | FROM users |
| 500 | WHERE active = true |
| 501 | ORDER BY name |
| 502 | LIMIT 10` |
| 503 | |
| 504 | offsets := []int{0, 10, 25, 50, 75, 100} |
| 505 | |
| 506 | b.ReportAllocs() |
| 507 | b.ResetTimer() |
| 508 | for i := 0; i < b.N; i++ { |
| 509 | offset := offsets[i%len(offsets)] |
| 510 | _, _ = offsetToLineColumn(content, offset) |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | // setupTestServer creates a test server with mock I/O |
| 515 | func setupTestServer() *Server { |
nothing calls this directly
no test coverage detected