Skip to content

Commit

Permalink
Fix router test
Browse files Browse the repository at this point in the history
Ensure that String is tested
  • Loading branch information
joshka committed Aug 27, 2024
1 parent b7cb2ad commit 6eb34fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metrics-util/src/layers/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ mod tests {
let _ = RouterBuilder::from_recorder(MockTestRecorder::new()).build();

let mut builder = RouterBuilder::from_recorder(MockTestRecorder::new());
// ensure that &str, String, and Cow<str> are all are accepted by the builder
builder
.add_route(MetricKindMask::COUNTER, "foo", MockTestRecorder::new())
.add_route(MetricKindMask::GAUGE, "bar", MockTestRecorder::new())
.add_route(MetricKindMask::GAUGE, String::from("bar"), MockTestRecorder::new())
.add_route(MetricKindMask::HISTOGRAM, Cow::Borrowed("baz"), MockTestRecorder::new())
.add_route(MetricKindMask::ALL, "quux", MockTestRecorder::new());
let _ = builder.build();
Expand Down

0 comments on commit 6eb34fd

Please sign in to comment.