Skip to content

Commit

Permalink
Fix and improve testcase for multiple fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Voker57 committed Apr 27, 2024
1 parent 3bc1ee5 commit 5c6d75a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tracing-subscriber/src/filter/env/mod.rs
Expand Up @@ -924,7 +924,7 @@ mod tests {

#[test]
fn callsite_enabled_includes_span_directive_multiple_fields() {
let filter = EnvFilter::new("app[mySpan{field=\"value\",field2=2}]=debug")
let filter = EnvFilter::try_new("app[mySpan{field=\"value\",field2=2}]=debug").unwrap()
.with_collector(NoCollector);
static META: &Metadata<'static> = &Metadata::new(
"mySpan",
Expand All @@ -939,6 +939,20 @@ mod tests {

let interest = filter.register_callsite(META);
assert!(interest.is_never());

static META2: &Metadata<'static> = &Metadata::new(
"mySpan",
"app",
Level::TRACE,
None,
None,
None,
FieldSet::new(&["field", "field2"], identify_callsite!(&Cs)),
Kind::SPAN,
);

let interest = filter.register_callsite(META);
assert!(interest.is_always());
}

#[test]
Expand Down

0 comments on commit 5c6d75a

Please sign in to comment.