diff --git a/src/test_utils.rs b/src/test_utils.rs index 1a769ae1c..b738145b4 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -3,6 +3,7 @@ //! This module is only compiled for test runs. use std::collections::BTreeMap; +use std::fmt; use std::ops::Deref; use std::str::FromStr; use std::time::{Duration, Instant}; @@ -45,7 +46,6 @@ static CONTEXT_NAMES: Lazy>> = /// /// The temporary directory can be used to store the SQLite database, /// see e.g. [test_context] which does this. -// #[derive(Debug)] pub(crate) struct TestContext { pub ctx: Context, pub dir: TempDir, @@ -55,6 +55,17 @@ pub(crate) struct TestContext { event_sinks: Arc>>>, } +impl fmt::Debug for TestContext { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("TestContext") + .field("ctx", &self.ctx) + .field("dir", &self.dir) + .field("recv_idx", &self.recv_idx) + .field("event_sinks", &String::from("Vec")) + .finish() + } +} + impl TestContext { /// Creates a new [TestContext]. ///