mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
Add Debug back to TestContext
I accidentally removed this in an earlier PR.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
//! This module is only compiled for test runs.
|
//! This module is only compiled for test runs.
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
use std::fmt;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
@@ -45,7 +46,6 @@ static CONTEXT_NAMES: Lazy<std::sync::RwLock<BTreeMap<u32, String>>> =
|
|||||||
///
|
///
|
||||||
/// The temporary directory can be used to store the SQLite database,
|
/// The temporary directory can be used to store the SQLite database,
|
||||||
/// see e.g. [test_context] which does this.
|
/// see e.g. [test_context] which does this.
|
||||||
// #[derive(Debug)]
|
|
||||||
pub(crate) struct TestContext {
|
pub(crate) struct TestContext {
|
||||||
pub ctx: Context,
|
pub ctx: Context,
|
||||||
pub dir: TempDir,
|
pub dir: TempDir,
|
||||||
@@ -55,6 +55,17 @@ pub(crate) struct TestContext {
|
|||||||
event_sinks: Arc<RwLock<Vec<Box<EventSink>>>>,
|
event_sinks: Arc<RwLock<Vec<Box<EventSink>>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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<EventSink>"))
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl TestContext {
|
impl TestContext {
|
||||||
/// Creates a new [TestContext].
|
/// Creates a new [TestContext].
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user