#[cfg(not(target_arch = "wasm32"))]
#[path = "fixture.rs"]
mod fixture;
#[cfg(not(target_arch = "wasm32"))]
#[allow(unused_imports)]
pub use fixture::*;
#[cfg(not(target_arch = "wasm32"))]
pub mod proxy;
#[allow(dead_code)]
pub const FIXTURE_HOST: &str = "zenwave-fixture.test";
#[allow(dead_code)]
pub fn resolve_for_proxy(host: &str, port: u16) -> (String, u16) {
if host == FIXTURE_HOST {
("127.0.0.1".to_owned(), port)
} else {
(host.to_owned(), port)
}
}
#[cfg(not(target_arch = "wasm32"))]
pub mod socks5;
#[cfg(not(target_arch = "wasm32"))]
pub mod tls;
#[cfg(target_arch = "wasm32")]
mod local {
const HTTPBIN_BASE: &str = match option_env!("ZENWAVE_TEST_BASE_URL") {
Some(base) => base,
None => panic!(
"ZENWAVE_TEST_BASE_URL must be set when compiling the wasm tests; \
scripts/test-wasm.sh starts the fixture and exports it"
),
};
pub fn httpbin_base() -> String {
HTTPBIN_BASE.trim_end_matches('/').to_string()
}
pub fn httpbin_uri(path: &str) -> String {
format!("{}/{}", httpbin_base(), path.trim_start_matches('/'))
}
}
#[cfg(target_arch = "wasm32")]
#[allow(unused_imports)]
pub use local::*;