Skip to content

Move authorsAlpha and authorsAlphaLNI tests to BracketedPatternTest#14517

Merged
koppor merged 3 commits into
JabRef:mainfrom
shubhamk0205:fix-for-issue-13930
Dec 5, 2025
Merged

Move authorsAlpha and authorsAlphaLNI tests to BracketedPatternTest#14517
koppor merged 3 commits into
JabRef:mainfrom
shubhamk0205:fix-for-issue-13930

Conversation

@shubhamk0205

Copy link
Copy Markdown
Contributor

Closes #13930

Moves concrete pattern tests for [authorsAlpha] and [authorsAlphaLNI] from CitationKeyGeneratorTest to BracketedPatternTest, following the same pattern as the lastAuthor migration in PR #676. This addresses the comment in CitationKeyGeneratorTest that concrete patterns should be tested at BracketedPatternTest rather than in the citation key generator test class. The tests are now properly located where they test the pattern logic directly using AuthorList objects, rather than testing the full citation key generation flow with BibEntry objects.

Steps to test

  1. Run the test suite for BracketedPatternTest:h
    ./gradlew :jablib:test --tests "org.jabref.logic.citationkeypattern.BracketedPatternTest"
    2. Verify that the authorsAlpha() and authorsAlphaLNI() test methods pass with all test cases, including the newly migrated ones:

    • Test cases for single authors (e.g., "I. Newton" → "New")
    • Test cases for multiple authors (e.g., "I. Newton and J. Maxwell" → "NM")
    • Test cases with "von" prefixes (e.g., "Wil van der Aalst" → "vdAal")
    • Test cases with "and others" (e.g., "Isaac Newton and James Maxwell and others" → "NM+")
  2. Verify that CitationKeyGeneratorTest still compiles and runs successfully:
    ./gradlew :jablib:test --tests "org.jabref.logic.citationkeypattern.CitationKeyGeneratorTest"
    4. Confirm that no references to the removed test methods or constants exist in CitationKeyGeneratorTest.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license

  • I manually tested my changes in running JabRef (always required)

  • I added JUnit tests for changes (if applicable)

  • [/] I added screenshots in the PR description (if change is visible to the user)

  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)

  • [/] I checked the user 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 updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Dec 4, 2025
@github-actions github-actions Bot removed the status: changes-required Pull requests that are not yet complete label Dec 4, 2025
@koppor

koppor commented Dec 5, 2025

Copy link
Copy Markdown
Member

I am out of context, but I hope the issue was right.

@koppor koppor added this pull request to the merge queue Dec 5, 2025
Merged via the queue into JabRef:main with commit 50a79cd Dec 5, 2025
48 checks passed
@subhramit

Copy link
Copy Markdown
Member

following the same pattern as the lastAuthor migration in PR #676.

Which PR is this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test concrete patterns in BracketedPatternTest

3 participants