Skip to content

Commit

Permalink
Test Reader not required to be comparable
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Oct 21, 2022
1 parent bc8288a commit 8dc3789
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sdk/metric/reader_test.go
Expand Up @@ -236,3 +236,15 @@ func TestDefaultTemporalitySelector(t *testing.T) {
assert.Equal(t, metricdata.CumulativeTemporality, DefaultTemporalitySelector(ik))
}
}

type notComparable [0]func() // nolint:unused // non-comparable type itself is used.

type noCompareReader struct {
notComparable // nolint:unused // non-comparable type itself is used.
Reader
}

func TestReadersNotRequiredToBeComparable(t *testing.T) {
r := noCompareReader{Reader: NewManualReader()}
assert.NotPanics(t, func() { _ = NewMeterProvider(WithReader(r)) })
}

0 comments on commit 8dc3789

Please sign in to comment.