Files
seaweedFS/weed/util/inits_test.go
promalert 9012069bd7 chore: execute goimports to format the code (#7983)
* chore: execute goimports to format the code

Signed-off-by: promalert <promalert@outlook.com>

* goimports -w .

---------

Signed-off-by: promalert <promalert@outlook.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>
2026-01-07 13:06:08 -08:00

21 lines
576 B
Go

package util
import (
"testing"
"github.com/stretchr/testify/assert"
)
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))
assert.Equal(t, "1 3 5", HumanReadableInts(5, 1, 3))
assert.Equal(t, "1-3 5", HumanReadableInts(1, 2, 3, 5))
assert.Equal(t, "1-3 5 7-9", HumanReadableInts(7, 9, 8, 1, 2, 3, 5))
}