Fix a prefix issue with error leafs.

This commit is contained in:
Dave Halter
2018-04-22 19:28:30 +02:00
parent 579146b501
commit f20106d88e
2 changed files with 21 additions and 6 deletions

View File

@@ -227,3 +227,11 @@ def test_endmarker_end_pos():
def test_indentation(code, types):
actual_types = [t.type for t in _get_token_list(code)]
assert actual_types == types + [ENDMARKER]
def test_error_string():
t1, endmarker = _get_token_list(' "\n')
assert t1.type == ERRORTOKEN
assert t1.prefix == ' '
assert t1.string == '"\n'
assert endmarker.string == ''