Skip to content

Commit

Permalink
Add TestRecordDroppedAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Apr 10, 2024
1 parent 849367e commit 30c5958
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sdk/log/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,17 @@ func TestRecordClone(t *testing.T) {
return assert.Truef(t, kv.Equal(attr1), "%v != %v", kv, attr1)
})
}

func TestRecordDroppedAttributes(t *testing.T) {
for i := 1; i < attributesInlineCount*5; i++ {
r := new(Record)
r.attributeCountLimit = 1

attrs := make([]log.KeyValue, i)
r.AddAttributes(attrs...)
assert.Equalf(t, i-1, r.DroppedAttributes(), "%d: AddAttributes", i)

r.SetAttributes(attrs...)
assert.Equalf(t, i-1, r.DroppedAttributes(), "%d: SetAttributes", i)
}
}

0 comments on commit 30c5958

Please sign in to comment.