minor: fix lint errors by using assert.Len

I noticed while prepping another PR that golangci-lint fails at HEAD.

Generated with

```perl -pi -e 's/assert[.]Equal[(]t, (\d+), len[(]([^)]+)[)][)]/assert.Len(t, $2, $1)/' gateway/gateway_test.go```
This commit is contained in:
Patrick Xia 2023-10-22 17:42:11 -07:00 committed by patrick xia
parent 56e7bd01ca
commit a6daf411b9

View File

@ -170,15 +170,15 @@ func maketestRouter(input []byte) *Router {
func TestNewRouter(t *testing.T) { func TestNewRouter(t *testing.T) {
r := maketestRouter(testconfig) r := maketestRouter(testconfig)
assert.Equal(t, 1, len(r.Gateways)) assert.Len(t, r.Gateways, 1)
assert.Equal(t, 3, len(r.Gateways["bridge1"].Bridges)) assert.Len(t, r.Gateways["bridge1"].Bridges, 3)
assert.Equal(t, 3, len(r.Gateways["bridge1"].Channels)) assert.Len(t, r.Gateways["bridge1"].Channels, 3)
r = maketestRouter(testconfig2) r = maketestRouter(testconfig2)
assert.Equal(t, 2, len(r.Gateways)) assert.Len(t, r.Gateways, 2)
assert.Equal(t, 3, len(r.Gateways["bridge1"].Bridges)) assert.Len(t, r.Gateways["bridge1"].Bridges, 3)
assert.Equal(t, 2, len(r.Gateways["bridge2"].Bridges)) assert.Len(t, r.Gateways["bridge2"].Bridges, 2)
assert.Equal(t, 3, len(r.Gateways["bridge1"].Channels)) assert.Len(t, r.Gateways["bridge1"].Channels, 3)
assert.Equal(t, 2, len(r.Gateways["bridge2"].Channels)) assert.Len(t, r.Gateways["bridge2"].Channels, 2)
assert.Equal(t, &config.ChannelInfo{ assert.Equal(t, &config.ChannelInfo{
Name: "general", Name: "general",
Direction: "inout", Direction: "inout",