statement unittest v2

Timon Gehr timon.gehr at gmx.ch
Mon Apr 29 00:12:05 UTC 2024


On 4/28/24 15:47, monkyyy wrote:
> `unittest => 1==1;`
> `unittest math_still_works => 1==1;//generates ddoc`
> 
> I see roughly 3 criticisms to my last suggestion
> 
> 1. unittest without docs are bad
> 2. this is a bug; that should already work (???)
> 3. we may want agrumented unittests in the future
> 
> so handling the arguments out of order...
> 
> ```
> 

The previous proposal with `unittest(expression);` was better.

#1. unittest(1==1,"math broke"); /// test whether math still works

#2. It is not true and I do not think anyone claimed this.

#3. I don't understand a) what that would mean and b) `foreach` and 
shorthand `out` syntax already show how to do it.

So I think all of those objections should be dismissed and you got it 
right the first time.

OTOH `unittest => expression;` is weird because everywhere else `...=>r` 
just means `...{ return r; }`


More information about the dip.ideas mailing list