[squeak-dev] The Trunk: Tests-cmm.428.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Mar 16 23:37:06 UTC 2020

Hi Chris,

> simply to expose the bug

Wait, now I see the actual bug you are talking about. It took me some time to find this out, and when this is fixed, no one (except you :)) will be able to understand what this test should do. We should definitively add some more explaining comments to this. Also, an ideal test should never hang up/time out but fail instead, should it? :)

In this case, I see we need an extra test class for it. (Well, personally I would've used #newSubclass, but I see this is a matter of taste ^^). The "regular" #caseOf: tests should go to ObjectTest.

> are those three Object new fixtures exercising the function in a different way

No, the only difference is the index of the matched item. If you think this is irrelevant we can drop the bs and the cs. :)



Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Chris Muller <asqueaker at gmail.com>
Gesendet: Dienstag, 17. März 2020 00:09:18
An: The general-purpose Squeak developers list
Cc: packages at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Trunk: Tests-cmm.428.mcz

Hi Christoph,

This test is for Object>>#caseError only, not #caseOf:[otherwise:].  I started it out in ObjectTest, too, but then it looked like those tests were more "fundamental" while the purpose of this test was simply to expose the bug, so gave it its own class to expose the printing bug.

I think it sounds fine to include your other tests and rename it more general (heh, would that be "TestCase subclass: #CaseTest" ?   :)  ).  I took a quick look at your changeset and it looks good, the only question I would have is are those three Object new fixtures exercising the function in a different way?  Matching up the 'a''s 'b''s and 'c's was a bit tedious, especially trying to figure out if they're testing something unique or the same function..


On Mon, Mar 16, 2020 at 1:30 PM Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de<mailto:Christoph.Thiede at student.hpi.uni-potsdam.de>> wrote:

Hi Chris,

please have a look at Merge Request: #caseOf:otherwise: with arguments<http://forum.world.st/Merge-Request-caseOf-otherwise-with-arguments-td5112223.html> - I already tested #caseOf:[otherwise:] there in detail. If you think these tests are written badly, please let me know, I depend on your feedback :-)


Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org<mailto:squeak-dev-bounces at lists.squeakfoundation.org>> im Auftrag von commits at source.squeak.org<mailto:commits at source.squeak.org> <commits at source.squeak.org<mailto:commits at source.squeak.org>>
Gesendet: Samstag, 14. März 2020 00:09:39
An: squeak-dev at lists.squeakfoundation.org<mailto:squeak-dev at lists.squeakfoundation.org>; packages at lists.squeakfoundation.org<mailto:packages at lists.squeakfoundation.org>
Betreff: [squeak-dev] The Trunk: Tests-cmm.428.mcz

Chris Muller uploaded a new version of Tests to project The Trunk:

==================== Summary ====================

Name: Tests-cmm.428
Author: cmm
Time: 13 March 2020, 6:09:37.220407 pm
UUID: cd4af6d7-7fed-44c1-bfe7-64a2de3cb7ee
Ancestors: Tests-nice.427

Tests for #caseError.

=============== Diff against Tests-nice.427 ===============

Item was added:
+ TestCase subclass: #CaseErrorTest
+        instanceVariableNames: ''
+        classVariableNames: ''
+        poolDictionaries: ''
+        category: 'Tests-Bugs'!

Item was added:
+ ----- Method: CaseErrorTest>>printOn: (in category 'tests') -----
+ printOn: aStream
+        3 caseOf:
+                { [1] -> [aStream nextPutAll: 'option 1'].
+                [2] -> [aStream nextPutAll: 'option 2'] }
+        "caseError in printOn:"!

Item was added:
+ ----- Method: CaseErrorTest>>testCaseError (in category 'tests') -----
+ testCaseError
+        self
+                should:
+                        [2 caseOf:
+                                { [1] -> ['option 1'] }]
+                raise: Error!

Item was added:
+ ----- Method: CaseErrorTest>>testCaseErrorInPrintOn (in category 'tests') -----
+ testCaseErrorInPrintOn
+        self should: [ self printString ] raise: Error!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200316/3c12cf4e/attachment-0001.html>

More information about the Squeak-dev mailing list