pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 356 forks source link

testNoEquivalentSuperclassMethods should explicitely tell what methods are problematic #17334

Open demarey opened 2 weeks ago

demarey commented 2 weeks ago

We have this test that is bad because:

It should be updated by using a list of currently accepted redudant methods and provide a nice message telling the user what methods are problematic

testNoEquivalentSuperclassMethods

    | methods |
    "we do not care about methods that are installed from traits"
    methods := SystemNavigation new allMethods reject: [ :method | method isFromTrait ].

    methods := methods select: [ :method |
                   method overriddenMethod
                       ifNotNil: [ :overridenMethod | method equivalentTo: overridenMethod ]
                       ifNil: [ false ] ].

    self assert: methods size <= 326
MarcusDenker commented 2 weeks ago

yes, I wanted to actively kill the methods but dropped the ball (I did the same before e.g. for unused variables)

To see how the tests should look like, the unused vars one show how to add a list of known failures (e.g. from test data).

326 is a bit too much for such a whitelist, though.

A lot of the remaining are methods with pragmas that are copied down, these I think an not just be removed.