diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-04-20 10:56:24 -0700 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-04-20 10:56:24 -0700 |
| commit | 5c760523be1b48af4f831db8cfc969e937591a6a (patch) | |
| tree | 4b0407348b2658a601a23e1ec3ef748c8225bd2d /go/storage/volume_info_test.go | |
| parent | c42d33e8003078d9cea614953d9a34469925192e (diff) | |
| parent | dc47db5512877e898c585a7aaac371619979ab99 (diff) | |
| download | seaweedfs-5c760523be1b48af4f831db8cfc969e937591a6a.tar.xz seaweedfs-5c760523be1b48af4f831db8cfc969e937591a6a.zip | |
Merge pull request #128 from yanyiwu/master
[ui] Ordered VolumeInfos is more Human-readable
Diffstat (limited to 'go/storage/volume_info_test.go')
| -rw-r--r-- | go/storage/volume_info_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/go/storage/volume_info_test.go b/go/storage/volume_info_test.go new file mode 100644 index 000000000..9a9c43ad2 --- /dev/null +++ b/go/storage/volume_info_test.go @@ -0,0 +1,23 @@ +package storage + +import "testing" + +func TestSortVolumeInfos(t *testing.T) { + vis := []*VolumeInfo{ + &VolumeInfo{ + Id: 2, + }, + &VolumeInfo{ + Id: 1, + }, + &VolumeInfo{ + Id: 3, + }, + } + sortVolumeInfos(vis) + for i := 0; i < len(vis); i++ { + if vis[i].Id != VolumeId(i+1) { + t.Fatal() + } + } +} |
