refactor: extract shared test infrastructure into testutil module

- test_ctx(): single ServerCtx builder, replaces 3 copies (ctx/api/dot)
- mock_upstream(): canned DNS response server for forwarding tests
- blackhole_upstream(): unresponsive socket for timeout tests
- Removes ~100 lines of duplicated 30-field struct literals
This commit is contained in:
Razvan Dimescu
2026-04-13 07:56:47 +03:00
parent b8ddc16027
commit b40004fe5e
5 changed files with 128 additions and 173 deletions

View File

@@ -28,6 +28,9 @@ pub mod system_dns;
pub mod tls;
pub mod wire;
#[cfg(test)]
pub(crate) mod testutil;
pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Result<T> = std::result::Result<T, Error>;