seaweedfs/weed/storage/volume_info_test.go

28 lines
368 B
Go
Raw Normal View History

2015-04-20 17:22:13 +00:00
package storage
2019-04-19 04:43:36 +00:00
import (
"testing"
2019-09-02 10:28:40 +00:00
"github.com/joeslay/seaweedfs/weed/storage/needle"
2019-04-19 04:43:36 +00:00
)
2015-04-20 17:22:13 +00:00
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++ {
2019-04-19 04:43:36 +00:00
if vis[i].Id != needle.VolumeId(i+1) {
2015-04-20 17:22:13 +00:00
t.Fatal()
}
}
}