Fix #134: add regression test for multi-digit version extraction - #156
Open
elharo wants to merge 1 commit into
Open
Fix #134: add regression test for multi-digit version extraction#156elharo wants to merge 1 commit into
elharo wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #134
Summary
Issue #134 reports that
FilenameExposertruncates multi-digit version numbers (e.g.my-lib-12.3.4.jarwould yield version2.3.4).Investigation showed the described behavior does not reproduce.
FilenameExposerusesfilename.substring(mat.end() - 1), wheremat.end() - 1is the index of the first digit matched by the-\\dpattern.substring()therefore includes the full multi-digit version, somy-lib-12.3.4.jarcorrectly yields12.3.4,my-lib-10.jaryields10, etc. No source change is required.Test
Adds
FilenameExposerTest, which builds JARs in memory with version-specific filenames and assertsFilenameExposerextracts the full version:my-lib-12.3.4.jar→12.3.4my-lib-10.jar→10my-lib-21.5.7.jar→21.5.7my-lib-9.0.jar→9.0my-lib.jar→ no versionThese tests document the expected behavior and guard against regressions.