@@ -347,7 +347,7 @@ impl<'a> Tabs<'a> {
347347 where
348348 T : Into < Line < ' a > > ,
349349 {
350- self . padding_left = padding. into ( ) ;
350+ self . padding_right = padding. into ( ) ;
351351 self
352352 }
353353}
@@ -553,6 +553,24 @@ mod tests {
553553 test_case ( tabs, Rect :: new ( 0 , 0 , 30 , 1 ) , & expected) ;
554554 }
555555
556+ #[ test]
557+ fn render_left_padding ( ) {
558+ let tabs = Tabs :: new ( vec ! [ "Tab1" , "Tab2" , "Tab3" , "Tab4" ] ) . padding_left ( "---" ) ;
559+ let mut expected = Buffer :: with_lines ( [ "---Tab1 │---Tab2 │---Tab3 │---Tab4 " ] ) ;
560+ // first tab selected
561+ expected. set_style ( Rect :: new ( 3 , 0 , 4 , 1 ) , DEFAULT_HIGHLIGHT_STYLE ) ;
562+ test_case ( tabs, Rect :: new ( 0 , 0 , 40 , 1 ) , & expected) ;
563+ }
564+
565+ #[ test]
566+ fn render_right_padding ( ) {
567+ let tabs = Tabs :: new ( vec ! [ "Tab1" , "Tab2" , "Tab3" , "Tab4" ] ) . padding_right ( "++" ) ;
568+ let mut expected = Buffer :: with_lines ( [ " Tab1++│ Tab2++│ Tab3++│ Tab4++ " ] ) ;
569+ // first tab selected
570+ expected. set_style ( Rect :: new ( 1 , 0 , 4 , 1 ) , DEFAULT_HIGHLIGHT_STYLE ) ;
571+ test_case ( tabs, Rect :: new ( 0 , 0 , 40 , 1 ) , & expected) ;
572+ }
573+
556574 #[ test]
557575 fn render_more_padding ( ) {
558576 let tabs = Tabs :: new ( vec ! [ "Tab1" , "Tab2" , "Tab3" , "Tab4" ] ) . padding ( "---" , "++" ) ;
0 commit comments