Skip to content

Commit

Permalink
replace pollster with futures crate for future test
Browse files Browse the repository at this point in the history
  • Loading branch information
PonasKovas committed Dec 22, 2024
1 parent b69e492 commit 4ddf3c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ coerce = []
nightly = ["coerce"]

[dev-dependencies]
pollster = { version = "0.4.0", features = ["macro"] }
futures = { version = "0.3", default-features = false, features = ["executor"] }
7 changes: 4 additions & 3 deletions src/smallbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,11 @@ mod tests {
assert_eq!(cellbox.get(), 1);
}

#[pollster::test]
async fn test_future() {
#[test]
fn test_future() {
let boxed_fut: SmallBox<_, S1> = SmallBox::new(async { 123 });
assert_eq!(boxed_fut.await, 123);

assert_eq!(futures::executor::block_on(boxed_fut), 123);
}

#[test]
Expand Down

0 comments on commit 4ddf3c4

Please sign in to comment.