Skip to content

Add root time assertions#5

Merged
nfisher merged 1 commit into
mainfrom
codex/add-time.time-assertion-wrapper
Jun 16, 2026
Merged

Add root time assertions#5
nfisher merged 1 commit into
mainfrom
codex/add-time.time-assertion-wrapper

Conversation

@nfisher

@nfisher nfisher commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide root-package time.Time assertion helpers mirroring the existing hammy matchers so tests can use concise time assertions directly from gunit.
  • Support common time checks including equality, ordering, delta tolerance, and inclusive ranges for clearer test code.

Description

  • Add time.go with func Time(t T, actual time.Time) *Tim and type Tim struct { t T; actual time.Time } providing assertion methods.
  • Implement EqualTo, Before, BeforeOrEqual, After, AfterOrEqual, WithinDuration(expected time.Time, delta time.Duration), and WithinRange(start, end time.Time) in time.go.
  • Add time_test.go with unit tests mirroring hammy/time_test.go to cover success and failure cases for each new assertion.

Testing

  • Ran go test ./... and the test suite completed successfully.

Codex Task

@nfisher nfisher merged commit 3aa0cdf into main Jun 16, 2026
1 check passed
@nfisher nfisher deleted the codex/add-time.time-assertion-wrapper branch June 16, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant