Skip to content

Commit 36139a7

Browse files
committed
add boundary test for subtraction
1 parent 5fa7a08 commit 36139a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

staging/src/k8s.io/apimachinery/pkg/util/duration/duration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ func TestHumanDurationBoundaries(t *testing.T) {
7777
{d: 2 * 365 * 24 * time.Hour, want: "2y"},
7878
{d: 2*365*24*time.Hour + 23*time.Hour, want: "2y"},
7979
{d: 2*365*24*time.Hour + 23*time.Hour + 59*time.Minute, want: "2y"},
80+
{d: 2*365*24*time.Hour + 24*time.Hour - time.Millisecond, want: "2y"},
81+
{d: 2*365*24*time.Hour + 24*time.Hour, want: "2y1d"},
8082
{d: 3 * 365 * 24 * time.Hour, want: "3y"},
8183
{d: 4 * 365 * 24 * time.Hour, want: "4y"},
8284
{d: 5 * 365 * 24 * time.Hour, want: "5y"},

0 commit comments

Comments
 (0)