mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
fixed one off bug for all tests
This commit is contained in:
@@ -135,8 +135,9 @@ def run_related_name_test(correct, source, line_nr, index, line, path):
|
|||||||
print('test @%s: %s' % (line_nr - 1, line))
|
print('test @%s: %s' % (line_nr - 1, line))
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
correct = correct.strip()
|
||||||
comp_str = set('(%s,%s)' % r.start_pos for r in result)
|
comp_str = set('(%s,%s)' % r.start_pos for r in result)
|
||||||
correct = set(correct.strip().split(' '))
|
correct = set(correct.split(' ')) if correct else set()
|
||||||
if comp_str != correct:
|
if comp_str != correct:
|
||||||
print('Solution @%s not right, received %s, wanted %s'\
|
print('Solution @%s not right, received %s, wanted %s'\
|
||||||
% (line_nr - 1, comp_str, correct))
|
% (line_nr - 1, comp_str, correct))
|
||||||
@@ -172,7 +173,7 @@ def run_test(source, f_name, lines_to_execute):
|
|||||||
correct = r.group(2)
|
correct = r.group(2)
|
||||||
start += r.regs[2][0] # second group, start index
|
start += r.regs[2][0] # second group, start index
|
||||||
else:
|
else:
|
||||||
index = len(line)
|
index = len(line) - 1 # -1 for the \n
|
||||||
# if a list is wanted, use the completion test, otherwise the
|
# if a list is wanted, use the completion test, otherwise the
|
||||||
# get_definition test
|
# get_definition test
|
||||||
path = completion_test_dir + os.path.sep + f_name
|
path = completion_test_dir + os.path.sep + f_name
|
||||||
|
|||||||
Reference in New Issue
Block a user