fixed async tests

This commit is contained in:
Max
2022-10-27 18:34:20 +02:00
parent ce4b7fcfff
commit 2a046a3df0
6 changed files with 104 additions and 26 deletions
+5 -5
View File
@@ -8,22 +8,22 @@ pub use self::mode::{Catch, Mania, Mode, Osu, Taiko};
#[rustfmt::skip]
macro_rules! test_map {
($mode:ident) => {{
#[cfg(not(any(feature = "async_tokio", feature = "async_str")))]
#[cfg(not(any(feature = "async_tokio", feature = "async_std")))]
{ common::test_map::<$mode>() }
#[cfg(any(feature = "async_tokio", feature = "async_str"))]
#[cfg(any(feature = "async_tokio", feature = "async_std"))]
{ common::test_map::<$mode>().await }
}};
}
#[cfg(not(any(feature = "async_tokio", feature = "async_str")))]
#[cfg(not(any(feature = "async_tokio", feature = "async_std")))]
pub fn test_map<M: Mode>() -> Beatmap {
let path = format!("./maps/{}.osu", M::TEST_MAP_ID);
Beatmap::from_path(path).unwrap()
}
#[cfg(any(feature = "async_tokio", feature = "async_str"))]
pub async fn test_map() -> Beatmap {
#[cfg(any(feature = "async_tokio", feature = "async_std"))]
pub async fn test_map<M: Mode>() -> Beatmap {
let path = format!("./maps/{}.osu", M::TEST_MAP_ID);
Beatmap::from_path(path).await.unwrap()