From cc50ea274aca081d57b115bb9490e4332bd1d776 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Thu, 15 May 2025 11:42:40 +0200 Subject: [PATCH] use tokio::test --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 2 +- src/utils/check_updates.rs | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59549045..8162a342 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5107,9 +5107,21 @@ dependencies = [ "mio", "pin-project-lite", "socket2", + "tokio-macros", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "tokio-native-tls" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index a62076f8..e8d0e94d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ phf = "0.11.3" phf_shared = "0.11.3" splines = "4.4.2" clap = { version = "4.5.37", features = ["derive"] } -tokio = "1.44.2" +tokio = { version = "1.44.2", features = ["macros"] } async-channel = "2.3.1" [target.'cfg(windows)'.dependencies] diff --git a/src/utils/check_updates.rs b/src/utils/check_updates.rs index 2145a258..07892d6a 100644 --- a/src/utils/check_updates.rs +++ b/src/utils/check_updates.rs @@ -93,8 +93,8 @@ async fn is_newer_release_available(max_retries: u8, seconds_between_retries: u8 mod tests { use super::*; - #[test] - fn fetch_latest_release_from_github() { + #[tokio::test] + async fn fetch_latest_release_from_github() { let result = is_newer_release_available(6, 2).await; result.expect("Latest release request from GitHub error"); }