Skip to content

Commit

Permalink
rm mapsEqual
Browse files Browse the repository at this point in the history
Signed-off-by: tiansuo114 <1729765480@qq.com>
  • Loading branch information
tiansuo114 committed Aug 8, 2024
1 parent a4bfe7a commit 919c379
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/karmadactl/cmdinit/kubernetes/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"net"
"os"
"reflect"
"testing"
"time"

Expand Down Expand Up @@ -543,21 +544,9 @@ func TestCommandInitOption_parseEtcdNodeSelectorLabelsMap(t *testing.T) {
t.Errorf("parseEtcdNodeSelectorLabelsMap() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !tt.wantErr && !mapsEqual(tt.opt.EtcdNodeSelectorLabelsMap, tt.expected) {
if !tt.wantErr && !reflect.DeepEqual(tt.opt.EtcdNodeSelectorLabelsMap, tt.expected) {
t.Errorf("parseEtcdNodeSelectorLabelsMap() = %v, want %v", tt.opt.EtcdNodeSelectorLabelsMap, tt.expected)
}
})
}
}

func mapsEqual(a, b map[string]string) bool {
if len(a) != len(b) {
return false
}
for k, v := range a {
if b[k] != v {
return false
}
}
return true
}

0 comments on commit 919c379

Please sign in to comment.