Proposal: Enhancing unittest with Inline Module-Level Statements

ryuukk_ ryuukk.dev at gmail.com
Thu Nov 21 07:02:25 UTC 2024


On Wednesday, 20 November 2024 at 17:10:30 UTC, monkyyy wrote:
> On Wednesday, 20 November 2024 at 09:48:06 UTC, Jonathan M 
> Davis wrote:
>> On Tuesday, November 19, 2024 11:11:58 PM MST Sharif yt via 
>> Digitalmars-d wrote:
>>> [...]
>>
>>> [...]
>>
>> Personally, I think that it will just encourage writing poor 
>> unit tests. Properly testing a function requires far more than 
>> a line or two unless the functions is absolutely trivial. And 
>> if you're writing more than a line or two, it just makes more 
>> sense to use the unittest blocks that we have. We should be 
>> encouraging more thorough testing, and this would do the exact 
>> opposite of that.
>>
>> So, IMHO, this would be adding more complication to the 
>> language just to try to make it easier to write inadequate 
>> tests, and I don't think think that we should be doing that.
>>
>> - Jonathan M Davis
>
> making things annoying doesn't make me do them right

unittest in the middle of a function is bad, to stay polite


More information about the Digitalmars-d mailing list