<s> import unittest <EOL> from Vintageous . vi . utils import modes <EOL> from Vintageous . state import State <EOL> from Vintageous . tests import get_sel <EOL> from Vintageous . tests import first_sel <EOL> from Vintageous . tests import ViewTest <EOL> from Vintageous . ex_commands import CURRENT_LINE_RANGE <EOL> class Test_ex_move_Moving_InNormalMode_SingleLine_DefaultStart ( ViewTest ) : <EOL> def testCanMoveDefaultLineRange ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> expected = '<STR_LIT>' <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToEof ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> expected = '<STR_LIT>' <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToBof ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> expected = '<STR_LIT>' <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToEmptyLine ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> expected = '<STR_LIT>' <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToSameLine ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT:address>' : '<STR_LIT:2>' } ) <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> expected = '<STR_LIT>' <EOL> self . assertEqual ( expected , actual ) <EOL> class Test_ex_move_Moveing_InNormalMode_MultipleLines ( ViewTest ) : <EOL> def setUp ( self ) : <EOL> super ( ) . setUp ( ) <EOL> self . range = { '<STR_LIT>' : '<STR_LIT:.>' , '<STR_LIT>' : <NUM_LIT:0> , '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : '<STR_LIT:.>' , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : [ ] } <EOL> def testCanMoveDefaultLineRange ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> expected = '<STR_LIT>' <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToEof ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> expected = '<STR_LIT>' <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToBof ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> expected = '<STR_LIT>' <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> self . assertEqual ( expected , actual ) <EOL> def testCanMoveToEmptyLine ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> expected = '<STR_LIT>' <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> self . assertEqual ( expected , actual ) <EOL> @ unittest . skip ( "<STR_LIT>" ) <EOL> def testCanMoveToSameLine ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT:address>' : '<STR_LIT:2>' , '<STR_LIT>' : self . range } ) <EOL> expected = '<STR_LIT>' <EOL> actual = self . view . substr ( self . R ( <NUM_LIT:0> , self . view . size ( ) ) ) <EOL> self . assertEqual ( expected , actual ) <EOL> class Test_ex_move_InNormalMode_CaretPosition ( ViewTest ) : <EOL> def testCanRepositionCaret ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> actual = list ( self . view . sel ( ) ) <EOL> expected = [ self . R ( ( <NUM_LIT:2> , <NUM_LIT:0> ) , ( <NUM_LIT:2> , <NUM_LIT:0> ) ) ] <EOL> self . assertEqual ( expected , actual ) <EOL> class Test_ex_move_ModeTransition ( ViewTest ) : <EOL> def testFromNormalModeToNormalMode ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) ) ) <EOL> state = State ( self . view ) <EOL> state . enter_normal_mode ( ) <EOL> self . view . run_command ( '<STR_LIT>' ) <EOL> prev_mode = state . mode <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT:address>' : '<STR_LIT:3>' } ) <EOL> state = State ( self . view ) <EOL> new_mode = state . mode <EOL> self . assertEqual ( prev_mode , new_mode ) <EOL> def testFromVisualModeToNormalMode ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) ) <EOL> state = State ( self . view ) <EOL> state . enter_visual_mode ( ) <EOL> prev_mode = state . mode <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> state = State ( self . view ) <EOL> new_mode = state . mode <EOL> self . assertNotEqual ( prev_mode , new_mode ) </s>
