diff options
| author | yanyiwu <i@yanyiwu.com> | 2015-04-21 01:22:13 +0800 |
|---|---|---|
| committer | yanyiwu <i@yanyiwu.com> | 2015-04-21 01:22:13 +0800 |
| commit | dc47db5512877e898c585a7aaac371619979ab99 (patch) | |
| tree | 4b0407348b2658a601a23e1ec3ef748c8225bd2d /go | |
| parent | b7a18580b8fc12448475ea2d782572e4ef5f8852 (diff) | |
| download | seaweedfs-dc47db5512877e898c585a7aaac371619979ab99.tar.xz seaweedfs-dc47db5512877e898c585a7aaac371619979ab99.zip | |
unittest: TestSortVolumeInfos
Diffstat (limited to '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() + } + } +} |
