std.experimental.testing PR review

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 26 08:46:25 PDT 2015


On Friday, 26 June 2015 at 15:32:47 UTC, Jacob Carlborg wrote:
> On 26/06/15 15:32, Dicebot wrote:
>> Just in case it wasn't clear : I will vote "no" on this 
>> proposal as long
>> as it features longish "readable" names like "shouldEquals".
>
> You would vote "no" because of this?

Totally. Remember - this is effectively will make specific API a 
language standard which will propagate it to all sort of 3d party 
libraries. I find it unacceptably unreadable and verbose, to the 
point it will make working with those libraries considerably 
harder.

I use `test!"=="(a. b)` which is:
- short
- robust (supports any binary operator D has)
- straight to the point (it is about testing, not about what 
program should/must do)

The fact that examples uncourage UFCS abuse makes it even worse. 
Something that looks like this:

`2.timesTwo.shouldEqual(4)`

.. gets immediately marked as garbage in my book.

There are also things like `shouldBeFalse` and `shouldBeTrue`. I 
couldn't imagine anyone seriously using names like that until I 
have examined that proposal.


More information about the Digitalmars-d mailing list