Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/db/car/forest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ pub fn new_forest_car_temp_path_in(
#[cfg(test)]
mod tests {
use super::*;
use crate::block_on;
use nunny::vec as nonempty;
use quickcheck_macros::quickcheck;
use tokio_test::block_on;

fn mk_encoded_car(
zstd_frame_size_tripwire: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/db/car/forest/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,8 @@ mod tests {
use super::*;
use ahash::{HashMap, HashSet};
use cid::Cid;
use futures::executor::block_on;
use tap::Tap as _;
use tokio_test::block_on;

/// [`Reader`] should behave like a [`HashMap`], with a caveat for collisions.
fn do_hashmap_of_cids(reference: HashMap<Cid, HashSet<u64>>) {
Expand Down
3 changes: 2 additions & 1 deletion src/db/car/plain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,12 @@ mod tests {
car_stream::{CarStream, CarV1Header},
car_util::load_car,
};
use futures::{TryStreamExt as _, executor::block_on};
use futures::TryStreamExt as _;
use fvm_ipld_blockstore::{Blockstore, MemoryBlockstore};
use std::io::Cursor;
use std::sync::LazyLock;
use tokio::io::{AsyncBufRead, AsyncSeek, BufReader};
use tokio_test::block_on;

#[test]
fn test_uncompressed_v1() {
Expand Down
9 changes: 0 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,3 @@ pub use key_management::{
};
pub use tool::main::main as forest_tool_main;
pub use wallet::main::main as forest_wallet_main;

#[cfg(test)]
fn block_on<T>(f: impl std::future::Future<Output = T>) -> T {
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.block_on(f)
}
2 changes: 1 addition & 1 deletion src/utils/db/car_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ mod tests {
use std::io::Cursor;

use super::*;
use crate::block_on;
use crate::utils::db::car_stream::CarWriter;
use crate::utils::multihash::prelude::*;
use ahash::HashSet;
Expand All @@ -56,6 +55,7 @@ mod tests {
use pretty_assertions::assert_eq;
use quickcheck::Arbitrary;
use quickcheck_macros::quickcheck;
use tokio_test::block_on;

#[derive(Debug, Clone)]
struct Blocks(Vec<CarBlock>);
Expand Down
Loading