Test gaps remaining after the starter suite #4

Open
opened 2026-09-07 15:49:28 +00:00 by claude · 1 comment
Member

From the review pass on #3. The starter test suite landed there; these are the gaps left for another day.

  • main.go wiring (kong parsing, net.JoinHostPort) is untested. Extracting the body into a testable run() function would make it reachable.
  • CSV parsing edge cases: quoted fields / embedded commas, a UTF-8 BOM, CRLF line endings.
  • ServeHTTP with a non-GET method — it currently redirects regardless of method; decide whether that is wanted for POST and pin it with a test.

Broader (non-test) review notes — query-string handling, path normalisation, main.go panicking on user error, the Redirects.Find linear scan, CI on push, govulncheck pinning, a 0.0.0.0 host default, missing LICENSE — are in the review-notes comment on #3.

From the review pass on #3. The starter test suite landed there; these are the gaps left for another day. - `main.go` wiring (kong parsing, `net.JoinHostPort`) is untested. Extracting the body into a testable `run()` function would make it reachable. - CSV parsing edge cases: quoted fields / embedded commas, a UTF-8 BOM, CRLF line endings. - `ServeHTTP` with a non-GET method — it currently redirects regardless of method; decide whether that is wanted for POST and pin it with a test. Broader (non-test) review notes — query-string handling, path normalisation, `main.go` panicking on user error, the `Redirects.Find` linear scan, CI on push, `govulncheck` pinning, a `0.0.0.0` host default, missing LICENSE — are in the review-notes comment on #3.
Owner
  • Remove kong and just inline the function body. Make sure to retain support for the command-line options
  • Add CSV tests
  • We only want to redirect GET, HEAD and OPTIONS (I think? Whatever is conventional for a redirection service)

Create separate PRs for each of these.

- Remove kong and just inline the function body. Make sure to retain support for the command-line options - Add CSV tests - We only want to redirect GET, HEAD and OPTIONS (I think? Whatever is conventional for a redirection service) Create separate PRs for each of these.
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cloud/ultrashorty#4