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.
		
		
		
		
		
			
		
			
				
					
					
						
							27 lines
						
					
					
						
							370 B
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							27 lines
						
					
					
						
							370 B
						
					
					
				| package storage | |
| 
 | |
| import ( | |
| 	"testing" | |
| 
 | |
| 	"github.com/seaweedfs/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() | |
| 		} | |
| 	} | |
| }
 |