def test_end_pos_error_correction():
 s = u('def x():\n .')
 m = ParserWithRecovery(load_grammar(), s).module
 func = m.children[0]
 assert (func.type == 'funcdef')
 assert (func.end_pos == (3, 0))
 assert (m.end_pos == (2, 2))

def test_end_pos_error_correction ( ) : s = u ( 'def x():\n .' ) m = ParserWithRecovery ( load_grammar ( ) , s ) . module func = m . children [ 0 ] assert ( func . type == 'funcdef' ) assert ( func . end_pos == ( 3 , 0 ) ) assert ( m . end_pos == ( 2 , 2 ) )
source code without ending newline are given one .