What's up with the assert enhancements proposed years ago?

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 24 07:08:30 PDT 2016


On 09/24/2016 04:03 AM, Martin Nowak wrote:
>
> assertPred!"=="(a, b);
> assertPred!"!"(a);
> assertPred!(std.range.equal)(a, b);
>
> Seems to do most of what DIP83 does w/ expensive feature design, and
> compiler implementation work.
> Also http://code.dlang.org/packages/unit-threaded comes with a couple of
> test comparators, though it follows ruby rspec's bad idea of giving
> every comparator a name (which has to be learnt and documented).

Yea, incidentally, I just started using unit-threaded for the first time 
this week, and so far, for the most part, I really quite like it a lot. 
But those comparator functions give me bad flashbacks of old-school Java.

Hmm, I wonder if Atila would be amenable to a more assertPred-like 
function in unit-threaded. Maybe a `should!"=="(leftSide, rightSide)` 
would fit in well. Or better yet, also adding in something like that 
that trick used in Andre's really nice recently proposed "dump" function 
(or whatever the name of it was), where it also prints out the actual 
argument provided in addition to the argument's value.



More information about the Digitalmars-d mailing list