Skip to content

Commit

Permalink
Test attributes comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Feb 19, 2025
1 parent 748c27d commit 96271e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions log/logtest/recorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func TestRecorderEmitAndReset(t *testing.T) {
r.SetSeverity(log.SeverityInfo)
r.SetTimestamp(time.Now())
r.SetBody(log.StringValue("Hello there"))
r.AddAttributes(log.Int("n", 1))
r.AddAttributes(log.String("foo", "bar"))
l.Emit(ctx, r)

got := rec.Result()
Expand All @@ -81,6 +83,10 @@ func TestRecorderEmitAndReset(t *testing.T) {
Context: ctx,
Severity: log.SeverityInfo,
Body: log.StringValue("Hello there"),
Attributes: []log.KeyValue{
log.String("foo", "bar"),
log.Int("n", 1),
},
},
},
}
Expand Down

0 comments on commit 96271e9

Please sign in to comment.