File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ impl StyledText {
51
51
}
52
52
53
53
pub fn paint ( & mut self ) -> String {
54
- println ! ( "{:?}" , self . start_styles) ;
55
54
let mut default_paint_type = PaintType :: FG ;
56
55
57
56
let start_codes_list: Vec < String > = self . start_styles
@@ -183,9 +182,16 @@ mod test {
183
182
use super :: * ;
184
183
185
184
#[ test]
186
- fn test_paint_type ( ) {
187
- let txt = txt ( "Siavash" ) . bright_blue ( ) . fg ( ) . red ( ) . bg ( ) . paint ( ) ;
188
- assert_eq ! ( true , false ) ;
185
+ fn white_fg_black_bg ( ) {
186
+ let raw_text = "I'm So Happy" ;
187
+ let styled_text = txt ( raw_text) . white ( ) . bg ( ) . black ( ) . fg ( ) . paint ( ) ;
188
+ assert_eq ! ( styled_text, "\x1b [47m\x1b [30mI'm So Happy\x1b [0m" ) ;
189
+ }
190
+
191
+ fn blue_fg_bright_cyan_bg ( ) {
192
+ let raw_text = "Silence is power" ;
193
+ let styled_text = txt ( raw_text) . blue ( ) . fg ( ) . bright_cyan ( ) . bg ( ) . paint ( ) ;
194
+ assert_eq ! ( styled_text, "\x1b [34m\x1b [106mSilence is power\x1b [0m" ) ;
189
195
}
190
196
191
197
#[ test]
You can’t perform that action at this time.
0 commit comments