ptth/crates/ptth_quic/src/tests.rs

22 lines
490 B
Rust
Raw Normal View History

#[test]
fn end_to_end () -> anyhow::Result <()> {
let rt = tokio::runtime::Runtime::new ()?;
rt.block_on (end_to_end_async ())?;
Ok (())
}
async fn end_to_end_async () -> anyhow::Result <()> {
use crate::executable_relay_server as relay;
let relay_opt = relay::Opt {
listen_addr: "127.0.0.1:0".to_string ().into (),
tcp_listen_port: None,
};
let relay_app = relay::App::new (relay_opt)?;
let task_relay = tokio::spawn (async move {
relay_app.run ().await
});
Ok (())
}