Skip to content

Commit

Permalink
add runtime test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsgf committed Sep 12, 2021
1 parent f28a62a commit 4d55b14
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tracing-attributes/tests/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ fn skip() {
.named("my_fn")
.at_level(Level::DEBUG)
.with_target("my_target");

let span3 = span::mock()
.named("my_fn2")
.at_level(Level::DEBUG)
.with_target("my_target");

let (subscriber, handle) = subscriber::mock()
.new_span(
span.clone()
Expand All @@ -124,12 +130,17 @@ fn skip() {
.enter(span2.clone())
.exit(span2.clone())
.drop_span(span2)
.new_span(span3.clone())
.enter(span3.clone())
.exit(span3.clone())
.drop_span(span3)
.done()
.run_with_handle();

with_default(subscriber, || {
my_fn(2, UnDebug(0), UnDebug(1));
my_fn(3, UnDebug(0), UnDebug(1));
my_fn2(2, UnDebug(0), UnDebug(1));
});

handle.assert_finished();
Expand Down

0 comments on commit 4d55b14

Please sign in to comment.