mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
osx compatibility tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32277 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
279239cb2a
commit
021c9eaf0e
1 changed files with 16 additions and 8 deletions
|
@ -144,14 +144,14 @@ int main()
|
|||
/* Check behavior when UNC paths are not supported.
|
||||
*/
|
||||
PASS([[@"//host/share/file.jpg" stringByDeletingLastPathComponent]
|
||||
isEqual: @"//host/share"],
|
||||
"'//host/file.jpg' stringByDeletingLastPathComponent == '//host/share'");
|
||||
isEqual: @"/host/share"],
|
||||
"'//host/file.jpg' stringByDeletingLastPathComponent == '/host/share'");
|
||||
PASS([[@"//host/share/" stringByDeletingLastPathComponent]
|
||||
isEqual: @"//host"],
|
||||
"'//host/share/' stringByDeletingLastPathComponent == '//host'");
|
||||
isEqual: @"/host"],
|
||||
"'//host/share/' stringByDeletingLastPathComponent == '/host'");
|
||||
PASS([[@"//host/share" stringByDeletingLastPathComponent]
|
||||
isEqual: @"//host"],
|
||||
"'//host/share' stringByDeletingLastPathComponent == '//host'");
|
||||
isEqual: @"/host"],
|
||||
"'//host/share' stringByDeletingLastPathComponent == '/host'");
|
||||
PASS([[@"//dir/" stringByDeletingLastPathComponent] isEqual: @"/"],
|
||||
"'//dir/' stringByDeletingLastPathComponent == '/'");
|
||||
|
||||
|
@ -238,6 +238,12 @@ int main()
|
|||
PASS_EQUAL([@"/home/../nicola" stringByStandardizingPath], @"/nicola",
|
||||
"/home/../nicola stringByStandardizingPath == /nicola");
|
||||
|
||||
PASS_EQUAL([@"home/../nicola" stringByStandardizingPath], @"home/../nicola",
|
||||
"home/../nicola stringByStandardizingPath == home/../nicola");
|
||||
|
||||
PASS_EQUAL([@"a/b/../c" stringByStandardizingPath], @"a/b/../c",
|
||||
"a/b/../c stringByStandardizingPath == a/b/../c");
|
||||
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSString *cwd = [fm currentDirectoryPath];
|
||||
NSString *tmpdir = NSTemporaryDirectory();
|
||||
|
@ -258,8 +264,10 @@ int main()
|
|||
[fm removeFileAtPath: tmpdst handler: nil];
|
||||
[fm removeFileAtPath: tmpsrc handler: nil];
|
||||
|
||||
PASS_EQUAL([@"/." stringByStandardizingPath], @"/",
|
||||
"/. stringByStandardizingPath == /");
|
||||
PASS_EQUAL([@"/.." stringByStandardizingPath], @"/",
|
||||
"/.. stringByStandardizingPath == /");
|
||||
PASS_EQUAL([@"/." stringByStandardizingPath], @"/.",
|
||||
"/. stringByStandardizingPath == /. (OSX special case)");
|
||||
|
||||
result = [NSArray arrayWithObjects: @"nicola",@"core",nil];
|
||||
result = [@"home" stringsByAppendingPaths:result];
|
||||
|
|
Loading…
Reference in a new issue