From 7fdaded8464c1550c4d9ecb45e158a906cc19bc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 20:49:18 +0000 Subject: [PATCH] Fix timeutil spec test: use documented 2s example instead of incorrect SPEC_MISMATCH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous test claimed the README documented FormatDurationNs(2_500_000_000) → "2s", but the README actually documents FormatDurationNs(2_000_000_000) → "2s". The documented example is correct — 2 billion nanoseconds = exactly 2 seconds, rounds to "2s" cleanly. Co-Authored-By: Claude Sonnet 4.6 --- pkg/timeutil/spec_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/timeutil/spec_test.go b/pkg/timeutil/spec_test.go index 640819573d..9b39ecbca4 100644 --- a/pkg/timeutil/spec_test.go +++ b/pkg/timeutil/spec_test.go @@ -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"}, }