Skip to content

Commit

Permalink
Add test_tokio_spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Hirrolot committed Feb 7, 2022
1 parent 62da2ca commit 3ab5763
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/dispatching2/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,27 @@ where
self.state.clone()
}
}

#[cfg(test)]
mod tests {
use std::convert::Infallible;

use teloxide_core::Bot;

use super::*;

#[tokio::test]
async fn test_tokio_spawn() {
tokio::spawn(async {
// Just check that this code compiles.
if false {
Dispatcher::<_, Infallible>::builder(Bot::new(""), dptree::entry())
.build()
.dispatch()
.await;
}
})
.await
.unwrap();
}
}

0 comments on commit 3ab5763

Please sign in to comment.