#NEWLINE# def test_smart_add_selections( self ) : #NEWLINE# #INDENT# '\n        Test whether adding carets during a run, results in the\n        corresponding caret positions after the run.\n        ' #NEWLINE# view = self . view #NEWLINE# regions = list ( self . start_regions ) #NEWLINE# view . run_command ( 'selection_fields' , { #NEWLINE# #INDENT# 'mode' : 'smart' , #NEWLINE# #UNINDENT# } ) #NEWLINE# for ( i , v ) in enumerate ( self . start_regions ) : #NEWLINE# #INDENT# sel = view . sel ( ) [ 0 ] #NEWLINE# new_sel = to_region ( ( sel . begin ( ) - 1 ) ) #NEWLINE# view . sel ( ) . add ( new_sel ) #NEWLINE# regions . insert ( ( i * 2 ) , to_region ( new_sel ) ) #NEWLINE# view . run_command ( 'selection_fields' , { #NEWLINE# #INDENT# 'mode' : 'smart' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . assertSelectionEqual ( view . sel ( ) , regions )