ptth/crates/ptth_quic/src/tests.rs

22 lines
494 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:30381".to_string ().into (),
tcp_listen_port: 8001.into (),
};
let task_relay = tokio::spawn (async move {
relay::main (relay_opt).await?;
Ok::<_, anyhow::Error> (())
});
Ok (())
}