[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find features de... #149

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-i18n-rfc-md-ful into dev 2026-04-02 07:14:26 +00:00
2 changed files with 10 additions and 0 deletions

View file

@ -54,6 +54,7 @@ func FormatAgo(count int, unit string) string {
}
func normalizeAgoUnit(unit string) string {
unit = core.Lower(core.Trim(unit))
switch unit {
case "seconds":
return "second"

View file

@ -173,6 +173,15 @@ func TestFormatAgo_Good_MorePluralUnitAliases(t *testing.T) {
}
}
func TestFormatAgo_Good_NormalisesUnitInput(t *testing.T) {
svc, err := New()
require.NoError(t, err)
SetDefault(svc)
got := FormatAgo(2, " Hours ")
assert.Equal(t, "2 hours ago", got)
}
func TestFormatAgo_Bad_UnknownUnit(t *testing.T) {
svc, err := New()
require.NoError(t, err)