Skip to content

Commit ee02ebd

Browse files
committed
Fix test to use assert.Len (testifylint)
1 parent 0552371 commit ee02ebd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/ottl/functions_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ func Test_newPath(t *testing.T) {
23912391
assert.Equal(t, "string", p.Name())
23922392
assert.Equal(t, "body.string[key]", p.String())
23932393
assert.Nil(t, p.Next())
2394-
assert.Equal(t, 1, len(p.Keys()))
2394+
assert.Len(t, p.Keys(), 1)
23952395
v, err := p.Keys()[0].String(context.Background(), struct{}{})
23962396
assert.NoError(t, err)
23972397
assert.Equal(t, "key", *v)
@@ -2492,7 +2492,7 @@ func Test_newPath_WithPathContextNames(t *testing.T) {
24922492
assert.Equal(t, tt.pathContext, p.Context())
24932493
}
24942494
assert.Nil(t, p.Next())
2495-
assert.Equal(t, 1, len(p.Keys()))
2495+
assert.Len(t, p.Keys(), 1)
24962496
v, err := p.Keys()[0].String(context.Background(), struct{}{})
24972497
assert.NoError(t, err)
24982498
assert.Equal(t, "key", *v)
@@ -2534,7 +2534,7 @@ func Test_newKey(t *testing.T) {
25342534
}
25352535
ks := newKeys[any](keys)
25362536

2537-
assert.Equal(t, 2, len(ks))
2537+
assert.Len(t, ks, 2)
25382538

25392539
s, err := ks[0].String(context.Background(), nil)
25402540
assert.NoError(t, err)

0 commit comments

Comments
 (0)