<s> from Vintageous . vi . utils import modes <EOL> from Vintageous . tests import add_sel <EOL> from Vintageous . tests import get_sel <EOL> from Vintageous . tests import first_sel <EOL> from Vintageous . tests import ViewTest <EOL> class Test_vi_repeat_star_InNormalMode ( ViewTest ) : <EOL> def testRepeatForward ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatForwardTwice ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatReverse ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatReverseTwice ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatForwardReverseTwiceForwardThrice ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> for i in range ( <NUM_LIT:0> , <NUM_LIT:2> ) : <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> for i in range ( <NUM_LIT:0> , <NUM_LIT:3> ) : <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatNoPartial ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) ] ) <EOL> class Test_vi_repeat_octothorp_InNormalMode ( ViewTest ) : <EOL> def testRepeatForward ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:12> , <NUM_LIT:12> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatReverse ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatNoPartial ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) ] ) <EOL> class Test_vi_repeat_slash_InNormalMode ( ViewTest ) : <EOL> def testRepeatForward ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:12> , <NUM_LIT:12> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatReverse ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatPartial ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:12> , <NUM_LIT:12> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> class Test_vi_repeat_question_mark_InNormalMode ( ViewTest ) : <EOL> def testRepeatForward ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:12> , <NUM_LIT:12> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatReverse ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : True } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:4> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) <EOL> def testRepeatPartial ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : '<STR_LIT:abc>' } ) <EOL> self . state . last_buffer_search_command = '<STR_LIT>' <EOL> self . assertEqual ( self . R ( <NUM_LIT:20> , <NUM_LIT:20> ) , first_sel ( self . view ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL , '<STR_LIT>' : False } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:12> , <NUM_LIT:12> ) , first_sel ( self . view ) ) <EOL> self . assertEqual ( self . view . get_regions ( '<STR_LIT>' ) , [ self . R ( <NUM_LIT:4> , <NUM_LIT:7> ) , self . R ( <NUM_LIT:12> , <NUM_LIT:15> ) , self . R ( <NUM_LIT:20> , <NUM_LIT> ) ] ) </s>
