Skip to content

Commit b0e973a

Browse files
ollie-etlollie-etl
andauthored
rt: add test for runtime panic (#159)
Co-authored-by: ollie-etl <Oliver [email protected]>
1 parent 8725b81 commit b0e973a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/runtime/mod.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,23 @@ impl Drop for Runtime {
130130
CONTEXT.with(|rc| rc.unset_driver())
131131
}
132132
}
133+
134+
#[cfg(test)]
135+
mod test {
136+
137+
use super::*;
138+
use crate::builder;
139+
140+
#[test]
141+
fn block_on() {
142+
let rt = Runtime::new(&builder()).unwrap();
143+
rt.block_on(async move { () });
144+
}
145+
146+
#[test]
147+
fn block_on_twice() {
148+
let rt = Runtime::new(&builder()).unwrap();
149+
rt.block_on(async move { () });
150+
rt.block_on(async move { () });
151+
}
152+
}

0 commit comments

Comments
 (0)