<s> import sublime <EOL> version = sublime . version ( ) <EOL> if version >= "<STR_LIT>" : <EOL> from UnitTesting . unittesting import DeferrableTestCase <EOL> else : <EOL> from unittesting import DeferrableTestCase <EOL> Lorem = ( """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" ) <EOL> class TestLongline ( DeferrableTestCase ) : <EOL> def setUp ( self ) : <EOL> s = sublime . load_settings ( "<STR_LIT>" ) <EOL> s . set ( "<STR_LIT>" , False ) <EOL> self . view = sublime . active_window ( ) . new_file ( ) <EOL> self . view . settings ( ) . set ( "<STR_LIT>" , True ) <EOL> self . view . settings ( ) . set ( "<STR_LIT>" , <NUM_LIT> ) <EOL> def tearDown ( self ) : <EOL> if self . view : <EOL> self . view . set_scratch ( True ) <EOL> self . view . window ( ) . focus_view ( self . view ) <EOL> self . view . window ( ) . run_command ( "<STR_LIT>" ) <EOL> def setText ( self , string ) : <EOL> self . view . run_command ( "<STR_LIT>" , { "<STR_LIT>" : string } ) <EOL> def getRow ( self , row ) : <EOL> return self . view . substr ( self . view . line ( self . view . text_point ( row , <NUM_LIT:0> ) ) ) <EOL> def test_long_line_end ( self ) : <EOL> self . setText ( Lorem ) <EOL> self . view . sel ( ) . clear ( ) <EOL> self . view . sel ( ) . add ( sublime . Region ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> for c in "<STR_LIT>" : <EOL> self . setText ( c ) <EOL> yield <NUM_LIT:10> <EOL> self . assertEqual ( self . getRow ( <NUM_LIT:5> ) , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . getRow ( <NUM_LIT:6> ) , "<STR_LIT>" ) <EOL> def test_long_line_middle ( self ) : <EOL> self . setText ( Lorem ) <EOL> self . view . sel ( ) . clear ( ) <EOL> self . view . sel ( ) . add ( sublime . Region ( <NUM_LIT:200> , <NUM_LIT:200> ) ) <EOL> for c in "<STR_LIT>" : <EOL> self . setText ( c ) <EOL> yield <NUM_LIT:10> <EOL> self . assertEqual ( <EOL> self . getRow ( <NUM_LIT:1> ) , <EOL> "<STR_LIT>" <EOL> ) </s>
