mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
Merge pull request #51784 from thaJeztah/api_less_reflect
api/types/network: remove use of "reflect" in test
This commit is contained in:
@@ -3,7 +3,6 @@ package network
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -531,7 +530,7 @@ func TestPortRange(t *testing.T) {
|
||||
for _, tc := range tests {
|
||||
pr := MustParsePortRange(tc.in)
|
||||
ports := slices.Collect(pr.All())
|
||||
if !reflect.DeepEqual(ports, tc.want) {
|
||||
if !slices.Equal(ports, tc.want) {
|
||||
t.Errorf("PortRange.All() = %#v, want %#v", ports, tc.want)
|
||||
}
|
||||
}
|
||||
@@ -546,7 +545,7 @@ func TestPortRange(t *testing.T) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if !reflect.DeepEqual(ports, want) {
|
||||
if !slices.Equal(ports, want) {
|
||||
t.Errorf("PortRange.All() = %#v, want %#v", ports, want)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user