statement unittest
Meta
jared771 at gmail.com
Sat Apr 6 06:33:07 UTC 2024
On Friday, 5 April 2024 at 17:34:43 UTC, monkyyy wrote:
> On Friday, 5 April 2024 at 15:38:28 UTC, Walter Bright wrote:
>> On 3/21/2024 12:39 PM, monkyyy wrote:
>>> i.e. `unittest(1==1)` would compile
>>
>> It's an interesting idea, but it would close the door on ever
>> having arguments to unittest blocks.
>
> why?
>
> ```d
> unittest identity(T)(T i){
> assert(i==i);
> }
> identity(1);
> identity(13.37);
> ```
>
> ```d
> unittest(1==1,"math broke");
> ```
>
> I dont think unittest syntax is constrained much
Instead why not just allow assert to be a top-level statement?
More information about the dip.ideas
mailing list