mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-28 03:47:57 +08:00
28 lines
370 B
Go
28 lines
370 B
Go
package storage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
|
)
|
|
|
|
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 != needle.VolumeId(i+1) {
|
|
t.Fatal()
|
|
}
|
|
}
|
|
}
|