#NEWLINE# def _test_impl( self , data , ref ) : #NEWLINE# #INDENT# res = [ ] #NEWLINE# while True : #NEWLINE# #INDENT# tok = self . lexer . token ( ) #NEWLINE# if ( not tok ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# res . append ( tok . type ) #NEWLINE# #UNINDENT# if is_string ( ref ) : #NEWLINE# #INDENT# ref = split ( ref ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . assertEqual ( res , ref ) #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# e = extract_exception ( ) #NEWLINE# cnt = 0 #NEWLINE# for ( i , j ) in zip ( res , ref ) : #NEWLINE# #INDENT# if ( not ( i == j ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# cnt += 1 #NEWLINE# #UNINDENT# print ( ( 'Break at index %d' % cnt ) ) #NEWLINE# raise e