@@ -35,13 +35,16 @@ mod compat_colors {
35
35
}
36
36
37
37
macro_rules! test_simple_style {
38
- ( $string: expr, $style : ident) => {
38
+ ( $string: expr, $colored_style : ident , $ansi_term_style : ident) => {
39
39
#[ test]
40
- fn $style ( ) {
41
- let s = format!( "{} {}" , $string, stringify!( $style ) ) ;
40
+ fn $colored_style ( ) {
41
+ let s = format!( "{} {}" , $string, stringify!( $colored_style ) ) ;
42
42
assert_eq!(
43
- s. $style( ) . to_string( ) ,
44
- ansi_term:: Style :: new( ) . $style( ) . paint( s) . to_string( )
43
+ s. $colored_style( ) . to_string( ) ,
44
+ ansi_term:: Style :: new( )
45
+ . $ansi_term_style( )
46
+ . paint( s)
47
+ . to_string( )
45
48
)
46
49
}
47
50
} ;
@@ -53,13 +56,13 @@ mod compat_styles {
53
56
use super :: colored;
54
57
use super :: colored:: * ;
55
58
56
- test_simple_style ! ( "test string" , bold) ;
57
- test_simple_style ! ( "test string" , dimmed) ;
58
- test_simple_style ! ( "test string" , italic) ;
59
- test_simple_style ! ( "test string" , underline) ;
60
- test_simple_style ! ( "test string" , blink) ;
61
- test_simple_style ! ( "test string" , reverse) ;
62
- test_simple_style ! ( "test string" , hidden) ;
59
+ test_simple_style ! ( "test string" , bold, bold ) ;
60
+ test_simple_style ! ( "test string" , dimmed, dimmed ) ;
61
+ test_simple_style ! ( "test string" , italic, italic ) ;
62
+ test_simple_style ! ( "test string" , underline, underline ) ;
63
+ test_simple_style ! ( "test string" , blink, blink ) ;
64
+ test_simple_style ! ( "test string" , reversed , reverse) ;
65
+ test_simple_style ! ( "test string" , hidden, hidden ) ;
63
66
}
64
67
65
68
macro_rules! test_simple_bgcolor {
0 commit comments