Skip to content

Commit d0c992a

Browse files
committed
add test for large difference between used and total
1 parent 73debf8 commit d0c992a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/clistat/stat_internal_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ func TestResultString(t *testing.T) {
4141
Expected: "1.2 things",
4242
Result: Result{Used: 1.234, Total: nil, Unit: "things", Prefix: "invalid"},
4343
},
44+
{
45+
Expected: "0.0/100.0 TiB (0%)",
46+
Result: Result{Used: 1, Total: ptr.To(1024 * 1024 * 1024 * 1024 * 100.0), Unit: "B", Prefix: "Ti"},
47+
},
4448
} {
4549
assert.Equal(t, tt.Expected, tt.Result.String())
4650
}

0 commit comments

Comments
 (0)