Skip to content

Commit

Permalink
minor: fix lint errors by using assert.Len
Browse files Browse the repository at this point in the history
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```
  • Loading branch information
patrickxia committed Oct 23, 2023
1 parent 56e7bd0 commit a6daf41
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ func maketestRouter(input []byte) *Router {

func TestNewRouter(t *testing.T) {
r := maketestRouter(testconfig)
assert.Equal(t, 1, len(r.Gateways))
assert.Equal(t, 3, len(r.Gateways["bridge1"].Bridges))
assert.Equal(t, 3, len(r.Gateways["bridge1"].Channels))
assert.Len(t, r.Gateways, 1)
assert.Len(t, r.Gateways["bridge1"].Bridges, 3)
assert.Len(t, r.Gateways["bridge1"].Channels, 3)
r = maketestRouter(testconfig2)
assert.Equal(t, 2, len(r.Gateways))
assert.Equal(t, 3, len(r.Gateways["bridge1"].Bridges))
assert.Equal(t, 2, len(r.Gateways["bridge2"].Bridges))
assert.Equal(t, 3, len(r.Gateways["bridge1"].Channels))
assert.Equal(t, 2, len(r.Gateways["bridge2"].Channels))
assert.Len(t, r.Gateways, 2)
assert.Len(t, r.Gateways["bridge1"].Bridges, 3)
assert.Len(t, r.Gateways["bridge2"].Bridges, 2)
assert.Len(t, r.Gateways["bridge1"].Channels, 3)
assert.Len(t, r.Gateways["bridge2"].Channels, 2)
assert.Equal(t, &config.ChannelInfo{
Name: "general",
Direction: "inout",
Expand Down

0 comments on commit a6daf41

Please sign in to comment.