mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-09-06 00:50:37 +02:00
glide has its own requirements. My previous workaround caused me some code checkin errors. Need to fix this.
24 lines
303 B
Go
24 lines
303 B
Go
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()
|
|
}
|
|
}
|
|
}
|