diff --git a/Tests/base/NSString/test02.m b/Tests/base/NSString/test02.m index 947b3c739..be2f7d137 100644 --- a/Tests/base/NSString/test02.m +++ b/Tests/base/NSString/test02.m @@ -107,6 +107,18 @@ int main() "'/' stringByDeletingLastPathComponent == '/'"); PASS([[@"hello" stringByDeletingLastPathComponent] isEqual: @""], "'hello' stringByDeletingLastPathComponent == ''"); + PASS_EQUAL([@"/hello/there/.." stringByDeletingLastPathComponent], + @"/hello/there", + "'/hello/there/..' stringByDeletingLastPathComponent == '/hello/there'"); + PASS_EQUAL([@"/hello/there/." stringByDeletingLastPathComponent], + @"/hello/there", + "'/hello/there/.' stringByDeletingLastPathComponent == '/hello/there'"); + PASS_EQUAL([@"/hello/../there" stringByDeletingLastPathComponent], + @"/hello/..", + "'/hello/../there' stringByDeletingLastPathComponent == '/hello/..'"); + PASS_EQUAL([@"/hello//../there" stringByDeletingLastPathComponent], + @"/hello/..", + "'/hello//../there' stringByDeletingLastPathComponent == '/hello/..'"); /* Check behavior for UNC absolute and relative paths. */