Skip to content

test: cover date-range logic and run go test in CI#3

Merged
ashishxcode merged 1 commit into
mainfrom
test/range-date-coverage
May 25, 2026
Merged

test: cover date-range logic and run go test in CI#3
ashishxcode merged 1 commit into
mainfrom
test/range-date-coverage

Conversation

@ashishxcode
Copy link
Copy Markdown
Owner

Follow-up to #2. Addresses the two highest-leverage gaps: zero test coverage, and CI that never ran go test.

Tests added

  • internal/model/range_test.goFromDates (single-day, multi-day, month/year rollover, empty-to default, bad input), FromMonth, and Preset boundary windows. Includes TestPresetBoundaries, a regression guard asserting each preset produces a whole-day half-open [Since, Until) window — the invariant the fix: anchor git date filters to local midnight #2 bug violated.
  • internal/collect/git_test.goanchorMidnight: bare ISO dates get 00:00:00; relative strings ("7 days ago", "yesterday"), empty, and already-timed values pass through untouched.

CI

Added go test -race ./... to .github/workflows/ci.yml (previously only gofmt, go vet, go build).

Verification

go test -race ./... → all green locally.

Add table tests for model.FromDates/FromMonth/Preset boundaries and
collect.anchorMidnight, including a regression guard for the date-skew
bug fixed in #2. Run 'go test -race ./...' in CI (previously only
gofmt/vet/build).
@ashishxcode ashishxcode merged commit e72cbed into main May 25, 2026
3 checks passed
@ashishxcode ashishxcode deleted the test/range-date-coverage branch May 25, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant