Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pkg/timeutil/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ func TestSpec_PublicAPI_FormatDurationNs(t *testing.T) {
{name: "zero returns em-dash", inputNs: 0, expected: "—"},
{name: "negative returns em-dash", inputNs: -1, expected: "—"},
// From spec code examples
// SPEC_MISMATCH: README documents FormatDurationNs(2_500_000_000) → "2s",
// but Go's time.Duration.Round(time.Second) rounds 2.5s away from zero to 3s.
// Using implementation-observed value "3s" here; README example may be incorrect.
{name: "spec example: 2.5 billion ns → rounded to second", inputNs: 2_500_000_000, expected: "3s"},
{name: "spec example: 2 billion ns → 2s", inputNs: 2_000_000_000, expected: "2s"},
{name: "spec example: 90 billion ns → 1m30s", inputNs: 90_000_000_000, expected: "1m30s"},
}

Expand Down