Status: Accepted
Owner: marianopeck Labels: Milestone-1.3 New issue 4129 by marianopeck: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 Fool discussion is here: http://forum.world.st/I-am-the-only-one-who-finds-assert-equals-oppostite-to-expected-td3485948.html Hi guys. I always code my tests something like this: testBlah | universalAnswer | universalAnswer := 30. universalAnswer := universalAnswer + 11. self assert: universalAnswer equals: 42. In this case, 42 is the "expected" and "universalAnswer" is the "actual" value. I feel weird writing like this: self assert: 42 equals: universalAnswer. I don't know why...but I do..the same as when doing should: [] raise: Error. In that case you put the "actual" first and the "expected" at the end... ok....the "problem" is that assert:equals: is in fact: asserts: expected equals: actual instead of asserts: actual equals: expected So, with my test I would receive a description in the debugger that says "'Expected 41 but was 42.'" which is completely the opposite. Of course, if I write my tests in the way I don't like, that is: self assert: 42 equals: universalAnswer. then i got the correct message "'Expected 42 but was 41.'" I don't pretend pharo change this because I guess it is standard, and blah blah blah. But senders of #assert:equals: should both, some written as mine (so the message is incorrect for them) and some correct. In addition, I think it is a problem of the selector name. If we could make it clearer, the won't be necessary to confuse "actual" with "expected". _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: FixProposed Comment #1 on issue 4129 by marianopeck: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 Name: SLICE-Issue-4129-AssertEqualsIsOppositeAsExpected-MarianoMartinezPeck.1 Author: MarianoMartinezPeck Time: 1 May 2011, 4:44:15 pm UUID: 88f528ef-98d0-452f-957c-1a0ad7eaa567 Ancestors: Dependencies: SUnit-MarianoMartinezPeck.40131 Fix to issue 4129 _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: Closed Comment #2 on issue 4129 by [hidden email]: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 in 13181 _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: FixProposed Cc: [hidden email] Comment #3 on issue 4129 by [hidden email]: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 This fix does not seem to be in #13268, the latest image I downloaded. What happened? _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: FixToInclude Comment #4 on issue 4129 by marianopeck: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 Wierd....I don't know :( I commit it again: Name: SLICE-Issue-4129-AssertEqualsAgain-mariano.1 Author: mariano Time: 22 June 2011, 4:59:08 pm UUID: 24cdc629-d1b3-43fc-8d63-5d92ec058663 Ancestors: Dependencies: SUnit-mariano.40143 Now it works? _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Labels: Milestone-1.4 Comment #5 on issue 4129 by [hidden email]: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 in 13273 TODO: 1.4 _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: Closed Comment #6 on issue 4129 by [hidden email]: #assert:equals: is the opposite as expected http://code.google.com/p/pharo/issues/detail?id=4129 in 14007 _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Free forum by Nabble | Edit this page |