aboutsummaryrefslogtreecommitdiff
path: root/src/testkit/display.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-23 17:07:22 -0700
committeriximeow <me@iximeow.net>2024-06-23 17:07:22 -0700
commit1fb5a7903bb44d44e298959d2637d858b2ea8e38 (patch)
tree15ae7bb8f58eba0966b28448f563276c3df70455 /src/testkit/display.rs
parenta8ec2d655ca59d7118ca1ea47dada705183b5442 (diff)
document new AnsiDisplaySink, add more -arch tests for sinks
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);