@@ -6,6 +6,7 @@ mod render_view_line;
6
6
use std:: fmt:: Debug ;
7
7
8
8
use bitflags:: bitflags;
9
+ use crossterm:: style:: Stylize as _;
9
10
10
11
#[ expect( unused_imports, reason = "Allowed for future use." ) ]
11
12
pub ( crate ) use self :: {
@@ -49,8 +50,8 @@ pub(crate) fn _assert_rendered_output(
49
50
let mut mismatch = false ;
50
51
let mut error_output = vec ! [
51
52
String :: from( "\n Unexpected output!" ) ,
52
- String :: from ( "--- Expected" ) ,
53
- String :: from ( "+++ Actual" ) ,
53
+ "--- Expected" . red ( ) . to_string ( ) ,
54
+ "+++ Actual" . green ( ) . to_string ( ) ,
54
55
String :: from( "==========" ) ,
55
56
] ;
56
57
@@ -63,26 +64,26 @@ pub(crate) fn _assert_rendered_output(
63
64
} ;
64
65
65
66
if expected_pattern. matches ( output) {
66
- error_output. push ( format ! ( " {}" , expected_pattern. expected( ) ) ) ;
67
+ error_output. push ( format ! ( " {}" , expected_pattern. expected( ) ) . white ( ) . to_string ( ) ) ;
67
68
}
68
69
else {
69
70
mismatch = true ;
70
- error_output. push ( format ! ( "-{}" , expected_pattern. expected( ) ) ) ;
71
- error_output. push ( format ! ( "+{}" , expected_pattern. actual( output) ) ) ;
71
+ error_output. push ( format ! ( "-{}" , expected_pattern. expected( ) ) . red ( ) . to_string ( ) ) ;
72
+ error_output. push ( format ! ( "+{}" , expected_pattern. actual( output) ) . green ( ) . to_string ( ) ) ;
72
73
}
73
74
}
74
75
75
76
match expected_patterns. len ( ) {
76
77
a if a > actual. len ( ) => {
77
78
mismatch = true ;
78
79
for expected_pattern in expected_patterns. iter ( ) . skip ( actual. len ( ) ) {
79
- error_output. push ( format ! ( "-{}" , expected_pattern. expected( ) . as_str( ) ) ) ;
80
+ error_output. push ( format ! ( "-{}" , expected_pattern. expected( ) . as_str( ) ) . red ( ) . to_string ( ) ) ;
80
81
}
81
82
} ,
82
83
a if a < actual. len ( ) => {
83
84
mismatch = true ;
84
85
for line in actual. iter ( ) . skip ( expected_patterns. len ( ) ) {
85
- error_output. push ( format ! ( "+{}" , replace_invisibles( line) ) ) ;
86
+ error_output. push ( format ! ( "+{}" , replace_invisibles( line) ) . green ( ) . to_string ( ) ) ;
86
87
}
87
88
} ,
88
89
_ => { } ,
0 commit comments