test: deepen and complete project-wide test coverage (#297)

* test: deepen coverage for health doctor provider and tunnels

* test: add broad trait and module re-export coverage
This commit is contained in:
Chummy
2026-02-16 18:58:24 +08:00
committed by GitHub
parent 79a6f180a8
commit 49fcc7a2c4
21 changed files with 1156 additions and 0 deletions

View File

@@ -26,3 +26,39 @@ impl Tunnel for NoneTunnel {
None
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn name_is_none() {
let tunnel = NoneTunnel;
assert_eq!(tunnel.name(), "none");
}
#[tokio::test]
async fn start_returns_local_url() {
let tunnel = NoneTunnel;
let url = tunnel.start("127.0.0.1", 7788).await.unwrap();
assert_eq!(url, "http://127.0.0.1:7788");
}
#[tokio::test]
async fn stop_is_noop_success() {
let tunnel = NoneTunnel;
assert!(tunnel.stop().await.is_ok());
}
#[tokio::test]
async fn health_check_is_always_true() {
let tunnel = NoneTunnel;
assert!(tunnel.health_check().await);
}
#[test]
fn public_url_is_always_none() {
let tunnel = NoneTunnel;
assert!(tunnel.public_url().is_none());
}
}