mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
unittest: TestSortVolumeInfos
This commit is contained in:
parent
b7a18580b8
commit
dc47db5512
23
go/storage/volume_info_test.go
Normal file
23
go/storage/volume_info_test.go
Normal file
|
@ -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…
Reference in a new issue