try showing the first 100 volume ids and an extra ...

This commit is contained in:
bingoohuang
2020-05-29 16:15:33 +08:00
parent 1a642b9876
commit 1f8782a1ed
3 changed files with 16 additions and 7 deletions

View File

@@ -5,6 +5,11 @@ import (
"testing"
)
func TestHumanReadableIntsMax(t *testing.T) {
assert.Equal(t, "1-2 ...", HumanReadableIntsMax(2, 1, 2, 3))
assert.Equal(t, "1 3 ...", HumanReadableIntsMax(2, 1, 3, 5))
}
func TestHumanReadableInts(t *testing.T) {
assert.Equal(t, "1-3", HumanReadableInts(1, 2, 3))
assert.Equal(t, "1 3", HumanReadableInts(1, 3))