Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testNoEquivalentSuperclassMethods should explicitely tell what methods are problematic #17334

Open
demarey opened this issue Nov 4, 2024 · 1 comment
Assignees

Comments

@demarey
Copy link
Contributor

demarey commented Nov 4, 2024

We have this test that is bad because:

  • if we remove redundant methods (accepted) and introduce new ones, we won’t get warned
  • it does not explicitly display a message with the faulty methods

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
Copy link
Member

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.

@MarcusDenker MarcusDenker self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants