Skip to content

Commit

Permalink
Add a test to demonstrate a timer panic
Browse files Browse the repository at this point in the history
  • Loading branch information
MOZGIII committed Apr 6, 2024
1 parent 47e19f7 commit c019c8c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions protocols/mdns/src/behaviour/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,17 @@ pub(crate) mod tokio {
(std::usize::MAX, None)
}
}

#[cfg(test)]
mod tests {
use futures::{future::poll_fn, StreamExt};

use super::Builder;

#[tokio::test]
async fn does_not_basic_with_basic_usage() {
let mut timer = super::TokioTimer::at(std::time::Instant::now());
poll_fn(|cx| (&mut timer).poll_next_unpin(cx)).await;

Check failure on line 141 in protocols/mdns/src/behaviour/timer.rs

View workflow job for this annotation

GitHub Actions / clippy (1.77.0)

this expression borrows a value the compiler would automatically borrow
}
}
}

0 comments on commit c019c8c

Please sign in to comment.