Skip to content

Commit

Permalink
rt: add test for runtime panic (#159)
Browse files Browse the repository at this point in the history
Co-authored-by: ollie-etl <Oliver Bunting@etlsystems.com>
  • Loading branch information
ollie-etl and ollie-etl authored Oct 31, 2022
1 parent 8725b81 commit b0e973a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,23 @@ impl Drop for Runtime {
CONTEXT.with(|rc| rc.unset_driver())
}
}

#[cfg(test)]
mod test {

use super::*;
use crate::builder;

#[test]
fn block_on() {
let rt = Runtime::new(&builder()).unwrap();
rt.block_on(async move { () });
}

#[test]
fn block_on_twice() {
let rt = Runtime::new(&builder()).unwrap();
rt.block_on(async move { () });
rt.block_on(async move { () });
}
}

0 comments on commit b0e973a

Please # to comment.