File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -85,14 +85,22 @@ def main():
8585 _filename = filename
8686 lines = match .string .splitlines ()
8787
88- line_no = match .string [:match .start ()].count ('\n ' )
88+ start_line_no = match .string [:match .start ()].count ('\n ' )
89+ end_line_no = match .string [:match .end ()].count ('\n ' )
8990 output_format = "{filename}:{line_no} {test.name}"
9091 print (output_format .format (
91- filename = filename , line_no = line_no + 1 , test = test ,
92+ filename = filename , line_no = start_line_no + 1 , test = test ,
9293 ))
9394 if test .hint :
9495 print ("Hint:" , test .hint )
95- print ("> " , lines [line_no ])
96+ match_lines = (
97+ "{line_no}> {code_line}" .format (
98+ line_no = no + start_line_no + 1 ,
99+ code_line = line ,
100+ )
101+ for no , line in enumerate (lines [start_line_no :end_line_no + 1 ])
102+ )
103+ print (* match_lines , sep = "\n " )
96104
97105 exit (exit_code )
98106
You can’t perform that action at this time.
0 commit comments