mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-31 13:07:46 +09:00 
			
		
		
		
	Add some sort stability
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
		| @@ -2,6 +2,7 @@ package integration | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"encoding/json" | 	"encoding/json" | ||||||
|  | 	"sort" | ||||||
| 	"testing" | 	"testing" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| @@ -51,10 +52,13 @@ func TestNamespaceCommand(t *testing.T) { | |||||||
| 	) | 	) | ||||||
| 	assert.NoError(t, err) | 	assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 	result := []string{listNamespaces[0].Name, listNamespaces[1].Name} | ||||||
|  | 	sort.Strings(result) | ||||||
|  |  | ||||||
| 	assert.Equal( | 	assert.Equal( | ||||||
| 		t, | 		t, | ||||||
| 		[]string{"namespace1", "namespace2"}, | 		[]string{"namespace1", "namespace2"}, | ||||||
| 		[]string{listNamespaces[0].Name, listNamespaces[1].Name}, | 		result, | ||||||
| 	) | 	) | ||||||
|  |  | ||||||
| 	_, err = scenario.Headscale().Execute( | 	_, err = scenario.Headscale().Execute( | ||||||
| @@ -83,10 +87,13 @@ func TestNamespaceCommand(t *testing.T) { | |||||||
| 	) | 	) | ||||||
| 	assert.NoError(t, err) | 	assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 	result = []string{listAfterRenameNamespaces[0].Name, listAfterRenameNamespaces[1].Name} | ||||||
|  | 	sort.Strings(result) | ||||||
|  |  | ||||||
| 	assert.Equal( | 	assert.Equal( | ||||||
| 		t, | 		t, | ||||||
| 		[]string{"namespace1", "newname"}, | 		[]string{"namespace1", "newname"}, | ||||||
| 		[]string{listAfterRenameNamespaces[0].Name, listAfterRenameNamespaces[1].Name}, | 		result, | ||||||
| 	) | 	) | ||||||
|  |  | ||||||
| 	err = scenario.Shutdown() | 	err = scenario.Shutdown() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user