Fixes #11066 - URIUtilTest.testFileUriGetUriLastPathSegment on macOS
We special-cased this test on macOS to support NFD form normalization. That may no longer be necessary, and therefore the test currently fails. Run the default expectations, and, in case of failure on macOS, test against the old workaround.
This commit is contained in:
parent
2812023db3
commit
665f61a3e7
|
@ -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