diff --git a/src/component.rs b/src/component.rs index 7822304..6a7f672 100644 --- a/src/component.rs +++ b/src/component.rs @@ -6,6 +6,7 @@ use crate::error::Error; +use std::fmt; use std::marker::Send; use std::ops::{Deref, DerefMut}; use std::pin::Pin; @@ -80,6 +81,17 @@ enum Expect { Callback(Box), } +impl fmt::Debug for Expect { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "Expect::")?; + match self { + Expect::Element(el) => write!(f, "Element({:?})", String::from(el)), + Expect::Callback(_) => write!(f, "Callback()"), + } + } +} + +#[derive(Debug)] pub struct TestComponent { in_buffer: Vec, out_buffer: Vec,