Browse Source

unittest: TestSortVolumeInfos

pull/128/head
yanyiwu 10 years ago
parent
commit
dc47db5512
  1. 23
      go/storage/volume_info_test.go

23
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()
}
}
}
Loading…
Cancel
Save