[squeak-dev] The Inbox: SUnit-ct.137.mcz

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Wed Jan 19 23:00:51 UTC 2022


Inbox because I would not be surprised if there were many (external) senders of this assertion that have aligned their assumptions about this selector to the previous reality. But I don't like this idea at all.

Here is a different idea which I even tend to prefer: Deprecate meaningless #shouldFix: and introduce new #shouldFail: which scans for TestResult exError.

As it turns out now, "TestResult error" was indeed used in more places than I was assuming which I now need to rewrite. If you agree to introduce #shouldFail:, then I can rewrite ~40 senders in the Trunk image from "self should: [...] raise: TestResult error" to "self shouldFail: [...]", which I would consider more elegant anyway. :-) Please give feedback!

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2022-01-19T22:54:56+00:00, commits at source.squeak.org wrote:

> A new version of SUnit was added to project The Inbox:
> http://source.squeak.org/inbox/SUnit-ct.137.mcz
> 
> ==================== Summary ====================
> 
> Name: SUnit-ct.137
> Author: ct
> Time: 19 January 2022, 11:54:53.214828 pm
> UUID: dd617d36-ff31-f143-932d-09d1c332f5dc
> Ancestors: SUnit-ct.136
> 
> Revises exception choice in TestCase >> #shouldFix:. It is a bad practice to handle, or even to search for arbitary Exceptions. Many mechanisms signal possibly unhandled "harmless" exceptions and rely on their #defaultAction. This includes accesses to the source files, debugging operations, and many others. The assertion in its current form makes little sense.
> 
> =============== Diff against SUnit-ct.136 ===============
> 
> Item was changed:
>   ----- Method: TestCase>>shouldFix: (in category 'asserting - extensions') -----
>   shouldFix: aBlock 
>   
> +     ^self should: aBlock raise: TestResult exError!
> -     ^self should: aBlock raise: Exception!
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220120/9390cb9f/attachment.html>


More information about the Squeak-dev mailing list