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

Ignore Initial Unprotected Uppercase In Translated Titles #10461

Merged

Conversation

michalfarago
Copy link
Contributor

@michalfarago michalfarago commented Oct 9, 2023

Fixes #10459

What was done:

Although not necessary, I've replaced the old while loop with following:
image

Since in test class there are two types of checkers:
image
I've separated the test to nested classes, so it's easier to see, which tests are related to which checker + the tests for valid/invalid title were grouped using @ParameterizedTest.
image

The message {0} is just a placeholder which contains previous test method name, to indicate user what does the test check.
The old tests were extended to also verify correct verification of the Title is in square brackets (translated title).
image

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@michalfarago michalfarago changed the title Update TitleChecker.java Ignore Initial Unprotected Uppercase In Translated Titles Oct 9, 2023
@michalfarago michalfarago marked this pull request as ready for review October 13, 2023 13:24
@calixtus
Copy link
Member

Can you please convert the tests to parameterized tests. They look jast as made for that 😉

Used Parametrized test with method source
Removed duplicate test
@michalfarago
Copy link
Contributor Author

michalfarago commented Oct 15, 2023

Can you please convert the tests to parameterized tests. They look jast as made for that 😉

Sure thing! I've rewritten them to use parameterized tests. I've used MethodSource, but let me know if you'd prefer to migrate them to a CSV file and use that instead (as there aren't many, I didn't find it necessary).

I've also noticed that there were some duplicate tests, where the tested title was the same, the operation was the same (asserEquals), but the method name was different. I've removed those duplicates as they check the same thing.

I've also kept the previous method names in the test display to indicate what the test checks, but let me know if I should only keep the titles.

On that note, the bibLaTex Checker allows some titles which the bibTex does not, so for now I didn't reuse the method source, but technically almost every Title should pass the bibLaTex checker:
image
so there should be no issue to use the same method source (even including the invalid one). Let me know if you're ok with reusing the same method sources for the checkers, where for bibLaTex Checke we would just call both of them like this @MethodSource({"invalidTitle", "validTitle"})

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 18, 2023
@Siedlerchr Siedlerchr added this pull request to the merge queue Oct 19, 2023
Merged via the queue into JabRef:main with commit 925a0c8 Oct 19, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bib(la)tex status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore initial unprotected uppercase in translated titles
4 participants