aboutsummaryrefslogtreecommitdiff
path: root/src/testkit/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/testkit/display.rs')
-rw-r--r--src/testkit/display.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testkit/display.rs b/src/testkit/display.rs
index 3cffd49..3cef59c 100644
--- a/src/testkit/display.rs
+++ b/src/testkit/display.rs
@@ -147,6 +147,18 @@ pub struct DisplaySinkWriteComparator<'sinks, T: DisplaySink, U: DisplaySink> {
}
impl<'sinks, T: DisplaySink, U: DisplaySink> DisplaySinkWriteComparator<'sinks, T, U> {
+ pub fn new(
+ t: &'sinks mut T, t_check: fn(&T) -> &str,
+ u: &'sinks mut U, u_check: fn(&U) -> &str
+ ) -> Self {
+ Self {
+ sink1: t,
+ sink1_check: t_check,
+ sink2: u,
+ sink2_check: u_check,
+ }
+ }
+
fn compare_sinks(&self) {
let sink1_text = (self.sink1_check)(self.sink1);
let sink2_text = (self.sink2_check)(self.sink2);