File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
regression/goto-instrument/document-properties-basic Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 33--document-properties-html
44^EXIT=0$
55^SIGNAL=0$
6- ^<em> assert\(1 == 1\);<\/em>$
6+ ^\s*\d+ <em> assert\(1 == 1\);<\/em>$
77--
88^warning: ignoring
99--
Original file line number Diff line number Diff line change @@ -225,6 +225,11 @@ document_propertiest::get_code(const source_locationt &source_location)
225225
226226 // build dest
227227
228+ std::size_t max_line_number_width = 0 ;
229+ if (!lines.empty ())
230+ {
231+ max_line_number_width = std::to_string (lines.back ().line_number ).size ();
232+ }
228233 for (std::list<linet>::iterator it=lines.begin ();
229234 it!=lines.end (); it++)
230235 {
@@ -235,10 +240,10 @@ document_propertiest::get_code(const source_locationt &source_location)
235240 switch (format)
236241 {
237242 case LATEX:
238- while (line_no.size ()< 4 )
243+ while (line_no.size () < max_line_number_width )
239244 line_no=" " +line_no;
240245
241- line_no+ " " ;
246+ line_no += " " ;
242247
243248 tmp+=escape_latex (it->text , true );
244249
@@ -248,10 +253,10 @@ document_propertiest::get_code(const source_locationt &source_location)
248253 break ;
249254
250255 case HTML:
251- while (line_no.size ()< 4 )
256+ while (line_no.size () < max_line_number_width )
252257 line_no=" " +line_no;
253258
254- line_no+ " " ;
259+ line_no += " " ;
255260
256261 tmp+=escape_html (it->text );
257262
@@ -261,7 +266,7 @@ document_propertiest::get_code(const source_locationt &source_location)
261266 break ;
262267 }
263268
264- dest+= tmp+ " \n " ;
269+ dest += line_no + tmp + " \n " ;
265270 }
266271
267272 return dest;
You can’t perform that action at this time.
0 commit comments