Merge pull request #11067 from kohlschuetter/pr/11066
Fixes #11066 - URIUtilTest.testFileUriGetUriLastPathSegment on macOS
This commit is contained in:
commit
fa7ea8a13c
|
@ -810,13 +810,25 @@ public class URIUtilTest
|
||||||
FS.touch(base);
|
FS.touch(base);
|
||||||
}
|
}
|
||||||
URI uri = base.toUri();
|
URI uri = base.toUri();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
assertThat(URIUtil.getUriLastPathSegment(uri), is(expectedName));
|
||||||
|
}
|
||||||
|
catch (AssertionError e)
|
||||||
|
{
|
||||||
if (OS.MAC.isCurrentOs())
|
if (OS.MAC.isCurrentOs())
|
||||||
{
|
{
|
||||||
// Normalize Unicode to NFD form that OSX Path/FileSystem produces
|
// Normalize Unicode to NFD form that OSX Path/FileSystem produces
|
||||||
expectedName = Normalizer.normalize(expectedName, Normalizer.Form.NFD);
|
expectedName = Normalizer.normalize(expectedName, Normalizer.Form.NFD);
|
||||||
}
|
|
||||||
assertThat(URIUtil.getUriLastPathSegment(uri), is(expectedName));
|
assertThat(URIUtil.getUriLastPathSegment(uri), is(expectedName));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Stream<Arguments> uriLastSegmentSource() throws IOException
|
public static Stream<Arguments> uriLastSegmentSource() throws IOException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue