You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
303 B

  1. package storage
  2. import "testing"
  3. func TestSortVolumeInfos(t *testing.T) {
  4. vis := []*VolumeInfo{
  5. &VolumeInfo{
  6. Id: 2,
  7. },
  8. &VolumeInfo{
  9. Id: 1,
  10. },
  11. &VolumeInfo{
  12. Id: 3,
  13. },
  14. }
  15. sortVolumeInfos(vis)
  16. for i := 0; i < len(vis); i++ {
  17. if vis[i].Id != VolumeId(i+1) {
  18. t.Fatal()
  19. }
  20. }
  21. }