Skip to content

Scaladoc: add tests for extension signatures #17108

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

Closed
KacperFKorban opened this issue Mar 15, 2023 · 2 comments · Fixed by #17133
Closed

Scaladoc: add tests for extension signatures #17108

KacperFKorban opened this issue Mar 15, 2023 · 2 comments · Fixed by #17133
Assignees

Comments

@KacperFKorban
Copy link
Member

Scaladoc should test signatures of extensions just like it's done for defs. This way we can prevent issues like #16647

The appropriate file for this is most likely:
https://github.com/lampepfl/dotty/blob/main/scaladoc/test/dotty/tools/scaladoc/signatures/SignatureTest.scala

@Dedelweiss
Copy link
Contributor

Hello, I would like to work on this issue. From what I understand the SignatureTest.scala file, it is linked to the TranslatableSignaturesTestCases.scala file which allows to call different scala files such as extensionParams.scala which contains examples of extension methods to test. So, is it enough to add new examples in this file (or another one), or do we need to modify the SignatureTest.scala file?

@KacperFKorban
Copy link
Member Author

@Dedelweiss I think that SignatureTest.scala will have to be modified to add checking for extension signatures. In TranslatableSignaturesTestCases.scala there already should exist more than enough tests for extension methods. The problem is that for those tests only the def part is tested to be present in generated scaladoc sites which allowed for bugs like #16647 to slip through. (where only the extension (...) part was wrongly generated)

KacperFKorban added a commit that referenced this issue Apr 3, 2023
In this PR, I added new tests examples for extensions's signatures.
To do that I did multiple changement :
### SignatureTest
- Added Extension for expected and actual signatures
- There needs to be a unique name for each signature, but extensions
don't have one like defs. So for now I have the signature itself as a
title (can change if better idea)
- Added "extensions" for member to test
### ExtensionParam
- I changed the extensions so that they are all unique and test
different cases.
### TranslatableSignaturesTestCases
- Added a filterNot for ExtensionMethodSignature class. Too many
duplicate extensions, it creates an error and I think it's not mandatory
to test the extensions on this file too.

Fixes: #17108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants