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

Bugfix for local repo casing issue on Linux #1750

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

anamnavi
Copy link
Member

@anamnavi anamnavi commented Nov 11, 2024

For the FindNameHelper() the regex was:
test_local_mod.\d+.\d+.\d+(?:[a-zA-Z0-9-.]+|.\d)?.nupkg

The first '.' matches any character whereas our intention with the regex is to match the literal '.' so I added a backslash before the '.' to escape it. If the package being searched for is test_local_mod it was matching test_local_mod.1.0.0.nupkg and also test_local_mod_2.1.0.0.nupkg where the '_' character was getting matched by '.' in regex
and 2.1.0.0 was getting considered as the version.

The main issue Amber had found was that for FindVersionHelper() the path for the .nupkg was being constructed and we use lowercasing so on Linux that path will not be correct. Instead, once we find a matching package (by name and version) we should use the path given from the file system that has the correct casing.

PR Summary

PR Context

PR Checklist

@anamnavi anamnavi changed the title change casing of tests Bugfix for local repo casing issue on Linux Nov 12, 2024
@@ -260,7 +260,7 @@ private FindResults FindNameHelper(string packageName, string[] tags, bool inclu
string actualPkgName = packageName;

// this regex pattern matches packageName followed by a version (4 digit or 3 with prerelease word)
string regexPattern = $"{packageName}" + @".\d+\.\d+\.\d+(?:[a-zA-Z0-9-.]+|.\d)?.nupkg";
string regexPattern = $"{packageName}" + @"\.\d+\.\d+\.\d+(?:[a-zA-Z0-9-.]+|.\d)?.nupkg";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this account for 2 digit versions

@alerickson
Copy link
Member

Other than the digit issue, everything else looks good.

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

Successfully merging this pull request may close these issues.

3 participants