mirror of
https://github.com/chenhg5/cc-connect.git
synced 2026-10-25 17:36:43 +08:00
fix(test): sort disabled_commands before comparison to avoid map iteration order flakiness
Made-with: Cursor
This commit is contained in:
1 parent
f3071ad632
commit
003d96d68b
1 file changed
+4
-2
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -1817,8 +1818,9 @@ func TestMgmt_ProjectPatch_DisabledCommands(t *testing.T) {
|
||||
t.Fatalf("patch disabled_commands failed: %s", r.Error)
|
||||
}
|
||||
got := e.GetDisabledCommands()
|
||||
if len(got) != 2 || got[0] != "new" || got[1] != "delete" {
|
||||
t.Fatalf("disabled_commands = %v, want [new delete]", got)
|
||||
sort.Strings(got)
|
||||
if len(got) != 2 || got[0] != "delete" || got[1] != "new" {
|
||||
t.Fatalf("disabled_commands = %v, want [delete new]", got)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user