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():
85
85
_filename = filename
86
86
lines = match .string .splitlines ()
87
87
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 ' )
89
90
output_format = "{filename}:{line_no} {test.name}"
90
91
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 ,
92
93
))
93
94
if test .hint :
94
95
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 " )
96
104
97
105
exit (exit_code )
98
106
You can’t perform that action at this time.
0 commit comments