-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: master
Are you sure you want to change the base?
Conversation
1312191
to
0a8f35e
Compare
0a8f35e
to
56b81a4
Compare
@dwalluck mind fixing the merge conflicts? |
56b81a4
to
61098f2
Compare
Needs #205 first. |
There is one more merge conflict that needs to be resolved. |
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. |
61098f2
to
63815d1
Compare
63815d1
to
aff90d8
Compare
Now that Spotless is there, there will be some conflicts. This should help:
|
aff90d8
to
86ea212
Compare
@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()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintentional merge issue.
No description provided.