File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -521,4 +521,30 @@ mod tests {
521521 let attrs: Vec < _ > = style. iter_attributes ( ) . collect ( ) ;
522522 assert_eq ! ( attrs, expected) ;
523523 }
524+
525+ #[ rstest]
526+ #[ case:: fg_color(
527+ TextStyle :: default ( ) . bold( ) . fg_color( Color :: Red ) ,
528+ TextStyle :: default ( ) . fg_color( Color :: Blue ) ,
529+ TextStyle :: default ( ) . bold( ) . fg_color( Color :: Blue )
530+ ) ]
531+ #[ case:: fg_color(
532+ TextStyle :: default ( ) . fg_color( Color :: Red ) ,
533+ TextStyle :: default ( ) . bold( ) . fg_color( Color :: Blue ) ,
534+ TextStyle :: default ( ) . bold( ) . fg_color( Color :: Blue )
535+ ) ]
536+ #[ case:: bg_color(
537+ TextStyle :: default ( ) . bold( ) . bg_color( Color :: Yellow ) ,
538+ TextStyle :: default ( ) . bg_color( Color :: Green ) ,
539+ TextStyle :: default ( ) . bold( ) . bg_color( Color :: Green )
540+ ) ]
541+ #[ case:: bg_color(
542+ TextStyle :: default ( ) . bg_color( Color :: Yellow ) ,
543+ TextStyle :: default ( ) . bold( ) . bg_color( Color :: Green ) ,
544+ TextStyle :: default ( ) . bold( ) . bg_color( Color :: Green )
545+ ) ]
546+ fn merge_overwrites_colors ( #[ case] mut some : TextStyle , #[ case] other : TextStyle , #[ case] output : TextStyle ) {
547+ some. merge ( & other) ;
548+ assert_eq ! ( some, output) ;
549+ }
524550}
You can’t perform that action at this time.
0 commit comments