aboutsummaryrefslogtreecommitdiff
path: root/weed/util/inits_test.go
diff options
context:
space:
mode:
authorbingoohuang <bingoo.huang@gmail.com>2020-05-29 15:37:58 +0800
committerbingoohuang <bingoo.huang@gmail.com>2020-05-29 15:37:58 +0800
commit1a642b98769ea604dfb74fa4d875bf42c24fda9f (patch)
tree115044480b7c8c726e0e5d0bb2f8716952ac74e9 /weed/util/inits_test.go
parentb4e93b639d95da4954052c583e2368baef2992c7 (diff)
downloadseaweedfs-1a642b98769ea604dfb74fa4d875bf42c24fda9f.tar.xz
seaweedfs-1a642b98769ea604dfb74fa4d875bf42c24fda9f.zip
add Volume Ids column only for max 100 volumes for convenience in the master ui.
Diffstat (limited to 'weed/util/inits_test.go')
-rw-r--r--weed/util/inits_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/util/inits_test.go b/weed/util/inits_test.go
new file mode 100644
index 000000000..f1ccb4f7b
--- /dev/null
+++ b/weed/util/inits_test.go
@@ -0,0 +1,14 @@
+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))
+}