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

fix: update code to pass latest test suite #174

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

Conversation

dwalluck
Copy link
Contributor

No description provided.

@dwalluck dwalluck force-pushed the update-test-suite branch from 0a8f35e to 56b81a4 Compare March 15, 2025 16:11
@jeremylong
Copy link
Collaborator

@dwalluck mind fixing the merge conflicts?

@dwalluck dwalluck force-pushed the update-test-suite branch from 56b81a4 to 61098f2 Compare March 16, 2025 13:26
@dwalluck
Copy link
Contributor Author

Needs #205 first.

@jeremylong
Copy link
Collaborator

There is one more merge conflict that needs to be resolved.

@dwalluck
Copy link
Contributor Author

This really needs #176 first, as this pull request basically contains a version of that pull request. I am not sure why I submitted the one required first after this one.

@dwalluck dwalluck force-pushed the update-test-suite branch from 61098f2 to 63815d1 Compare March 17, 2025 16:33
@dwalluck dwalluck changed the title Update for latest test suite fix: update code to latest test suite Mar 18, 2025
@dwalluck dwalluck changed the title fix: update code to latest test suite fix: update code to pass latest test suite Mar 18, 2025
@dwalluck dwalluck force-pushed the update-test-suite branch from 63815d1 to aff90d8 Compare March 18, 2025 18:39
@ppkarwasz
Copy link
Contributor

Now that Spotless is there, there will be some conflicts. This should help:

git checkout origin/master -- pom.xml
mvn spotless:apply

@dwalluck dwalluck force-pushed the update-test-suite branch from aff90d8 to 86ea212 Compare March 19, 2025 14:38
Comment on lines 63 to 93
@Test
void validPercentEncoding() throws MalformedPackageURLException {
PackageURL purl = new PackageURL("maven", "com.google.summit", "summit-ast", "2.2.0\n", null, null);
assertEquals("pkg:maven/com.google.summit/[email protected]%0A", purl.toString());
PackageURL purl2 =
new PackageURL("pkg:nuget/%D0%9Cicros%D0%BEft.%D0%95ntit%D1%83Fram%D0%B5work%D0%A1%D0%BEr%D0%B5");
assertEquals("Мicrosоft.ЕntitуFramеworkСоrе", purl2.getName());
assertEquals(
"pkg:nuget/%D0%9Cicros%D0%BEft.%D0%95ntit%D1%83Fram%D0%B5work%D0%A1%D0%BEr%D0%B5", purl2.toString());
}

@SuppressWarnings("deprecation")
@Test
void invalidPercentEncoding() throws MalformedPackageURLException {
assertThrowsExactly(
MalformedPackageURLException.class,
() -> new PackageURL("pkg:maven/com.google.summit/[email protected]%"));
assertThrowsExactly(
MalformedPackageURLException.class,
() -> new PackageURL("pkg:maven/com.google.summit/[email protected]%0"));
PackageURL purl = new PackageURL("pkg:maven/com.google.summit/[email protected]");
Throwable t1 = assertThrowsExactly(ValidationException.class, () -> purl.uriDecode("%"));
assertEquals("Incomplete percent encoding at offset 0 with value '%'", t1.getMessage());
Throwable t2 = assertThrowsExactly(ValidationException.class, () -> purl.uriDecode("a%0"));
assertEquals("Incomplete percent encoding at offset 1 with value '%0'", t2.getMessage());
Throwable t3 = assertThrowsExactly(ValidationException.class, () -> purl.uriDecode("aaaa%%0A"));
assertEquals("Invalid percent encoding char 1 at offset 5 with value '%'", t3.getMessage());
Throwable t4 = assertThrowsExactly(ValidationException.class, () -> purl.uriDecode("%0G"));
assertEquals("Invalid percent encoding char 2 at offset 2 with value 'G'", t4.getMessage());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unintentional merge issue.

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.

3 participants