mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
15 lines
402 B
Go
15 lines
402 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
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))
|
||
|
}
|