<s> from Vintageous . vi . utils import modes <EOL> from Vintageous . tests import set_text <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_g_g_InNormalMode ( ViewTest ) : <EOL> def testCanMoveInNormalMode ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:5> , <NUM_LIT:5> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) , first_sel ( self . view ) ) <EOL> def testGoToHardEofIfLastLineIsEmpty ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:5> , <NUM_LIT:5> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . NORMAL } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:0> , <NUM_LIT:0> ) , first_sel ( self . view ) ) <EOL> class Test_vi_g_g_InVisualMode ( ViewTest ) : <EOL> def testCanMoveInVisualMode ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:2> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . VISUAL } ) <EOL> self . assertEqual ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:2> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) , first_sel ( self . view ) ) <EOL> def testCanMoveInVisualMode_Reversed ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:2> ) , ( <NUM_LIT:0> , <NUM_LIT:1> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . VISUAL } ) <EOL> self . assertEqual ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:2> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) , first_sel ( self . view ) ) <EOL> class Test_vi_g_g_InInternalNormalMode ( ViewTest ) : <EOL> def testCanMoveInModeInternalNormal ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . INTERNAL_NORMAL } ) <EOL> self . assertEqual ( self . R ( <NUM_LIT:4> , <NUM_LIT:0> ) , first_sel ( self . view ) ) <EOL> class Test_vi_g_g_InVisualLineMode ( ViewTest ) : <EOL> def testCanMoveInModeVisualLine ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:4> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . VISUAL_LINE } ) <EOL> self . assertEqual ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:4> ) ) , first_sel ( self . view ) ) <EOL> def testExtendsSelection ( self ) : <EOL> self . write ( '<STR_LIT>' ) <EOL> self . clear_sel ( ) <EOL> self . add_sel ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:4> ) , ( <NUM_LIT:0> , <NUM_LIT:8> ) ) ) <EOL> self . view . run_command ( '<STR_LIT>' , { '<STR_LIT>' : modes . VISUAL_LINE } ) <EOL> self . assertEqual ( self . R ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:8> ) ) , first_sel ( self . view ) ) </s>
