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