Unit Testing in Action

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu Oct 26 01:23:14 UTC 2017


On Tuesday, October 24, 2017 19:15:35 Walter Bright via Digitalmars-d-
announce wrote:
> On 10/24/2017 3:06 PM, Ali Çehreli wrote:
> > It would be very useful if the compiler could do that automatically.
>
> On 10/24/2017 2:58 PM, qznc wrote:
>  > The information is there just not expressed in a useable way.
>
> The problem is how to display it in a text file with the original source
> code.

One option would be to add some sort of blank line (or with some kind of
comment) kind of like what github does when it breaks up a line to show a
diff. Github shows a line number next to the start of the actual line, and
no line numbers on the subsequent lines until you get to the line that's
actually the start of a new line. I don't know exactly how we'd do the same
thing with an .lst file (maybe by having a line that doesn't start with |),
but it at least seems like trying _something_ like that might work well. It
does have the downside though that some extra lines that aren't the actual
source code would in there, which may be acceptable but isn't entirely
desirable.

Another option would be to present multiple numbers with + signs, e.g
instead of

      5|    if(foo || bar)

do something like

      3+2|    if(foo || bar)

That might push the code farther to the right than might be desirable if you
have a line with a lot of branches and/or the branches are executed a lot of
times, but if someone really wants to see the info for each branch, then
that's not necessarily unreasonable.

- Jonathan M Davis




More information about the Digitalmars-d-announce mailing list