[Issue 5587] Use __LINE__ to pick number in unittest block names

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 29 13:03:31 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5587



--- Comment #7 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-04-29 12:59:43 PDT ---
(In reply to comment #5)
> > Why?  Either combine the functions into one,
> 
> Which introduces a complex special case.

Actually, you are right, this solution requires complex rewriting of the code. 
Probably not worth the effort.

> > or disallow that possibility
> > (shouldn't be too disruptive I would think).
> 
> D has no similar dependencies on line endings, this would be a bizarre
> exception.

It's not that bizarre.  It doesn't even have to go into the grammar.  All that
happens is you have the auto-namer name the two unit tests the same, and let
the semantic pass reject it (duplicate function definition).  This can easily
be explained to the user in the docs.

Besides, who puts two function blocks on the same line anyways?  I've seen
people write one or two statement functions on the same line, but never more
than one of those on the same line (except in obfuscation contests, but who
writes unit tests for those?)

My prediction is that if you did this you will never ever hear a complaint
about it :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list