Remove unused second part of the expiry counter
This commit is contained in:
@@ -89,6 +89,29 @@ func TestFormatRoundTrips(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The spellings themselves, not just their round trip: Duration.String() pads
|
||||
// out the units below the largest one, and trimming that tail is easy to get
|
||||
// wrong in a way that eats a real digit ("1m30s" must not become "1m3").
|
||||
func TestFormatDurationSpelling(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
in time.Duration
|
||||
want string
|
||||
}{
|
||||
{Unlimited, "never"},
|
||||
{30 * time.Second, "30s"},
|
||||
{time.Minute, "1m"},
|
||||
{90 * time.Second, "1m30s"},
|
||||
{90 * time.Minute, "1h30m"},
|
||||
{2 * time.Hour, "2h"},
|
||||
{25 * time.Hour, "25h"},
|
||||
{72 * time.Hour, "3d"},
|
||||
} {
|
||||
if got := FormatDuration(c.in); got != c.want {
|
||||
t.Errorf("FormatDuration(%s) = %q, want %q", c.in, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The convention is: one hyphen for a letter, two for a word. It is enforced
|
||||
// here because the stdlib flag package treats both forms as the same.
|
||||
func TestHyphenConvention(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user