mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@32970 72102866-910b-0410-8b05-ffd578937521
71 lines
4.1 KiB
Objective-C
71 lines
4.1 KiB
Objective-C
#import "Testing.h"
|
|
#import <Foundation/NSArray.h>
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
#import <Foundation/NSString.h>
|
|
|
|
int main()
|
|
{
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
|
PASS([[@"" pathComponents] count] == 0, "pathComponents ''");
|
|
PASS([[@"usr" pathComponents] count] == 1, "pathComponents 'usr'");
|
|
PASS([[@"usr/" pathComponents] count] == 2, "pathComponents 'usr/'");
|
|
PASS([[@"usr/bin" pathComponents] count] == 2, "pathComponents 'usr/bin'");
|
|
PASS([[@"usr//bin" pathComponents] count] == 2, "pathComponents 'usr//bin'");
|
|
PASS([[@"usr///bin" pathComponents] count] == 2, "pathComponents 'usr///bin'");
|
|
PASS([[@"/" pathComponents] count] == 1, "pathComponents '/'");
|
|
PASS([[@"/usr" pathComponents] count] == 2, "pathComponents '/usr'");
|
|
PASS([[@"/usr/" pathComponents] count] == 3, "pathComponents '/usr/'");
|
|
PASS([[@"/usr/bin" pathComponents] count] == 3, "pathComponents '/usr/bin'");
|
|
PASS([[@"/usr//bin" pathComponents] count] == 3, "pathComponents '/usr//bin'");
|
|
PASS([[@"/usr///bin" pathComponents] count] == 3, "pathComponents '/usr///bin'");
|
|
PASS([[@"" stringByAppendingPathComponent:@""] isEqual:@""],
|
|
"'' stringByAppendingPathComponent: ''");
|
|
PASS([[@"" stringByAppendingPathComponent:@"usr"] isEqual:@"usr"],
|
|
"'' stringByAppendingPathComponent: 'usr'");
|
|
PASS([[@"" stringByAppendingPathComponent:@"usr/"] isEqual:@"usr"],
|
|
"'' stringByAppendingPathComponent: 'usr/'");
|
|
PASS([[@"" stringByAppendingPathComponent:@"/usr"] isEqual:@"/usr"],
|
|
"'' stringByAppendingPathComponent: '/usr'");
|
|
PASS([[@"" stringByAppendingPathComponent:@"/usr/"] isEqual:@"/usr"],
|
|
"'' stringByAppendingPathComponent: '/usr/'");
|
|
PASS([[@"/" stringByAppendingPathComponent:@""] isEqual:@"/"],
|
|
"'/' stringByAppendingPathComponent: ''");
|
|
PASS([[@"/" stringByAppendingPathComponent:@"usr"] isEqual:@"/usr"],
|
|
"'/' stringByAppendingPathComponent: 'usr'");
|
|
PASS([[@"/" stringByAppendingPathComponent:@"usr/"] isEqual:@"/usr"],
|
|
"'/' stringByAppendingPathComponent: 'usr/'");
|
|
PASS([[@"/" stringByAppendingPathComponent:@"/usr"] isEqual:@"/usr"],
|
|
"'/' stringByAppendingPathComponent: '/usr'");
|
|
PASS([[@"/" stringByAppendingPathComponent:@"/usr/"] isEqual:@"/usr"],
|
|
"'/' stringByAppendingPathComponent: '/usr/'");
|
|
PASS([[@"usr" stringByAppendingPathComponent:@""] isEqual:@"usr"],
|
|
"'usr' stringByAppendingPathComponent: ''");
|
|
PASS([[@"usr" stringByAppendingPathComponent:@"bin"] isEqual:@"usr/bin"],
|
|
"'usr' stringByAppendingPathComponent: 'bin'");
|
|
PASS([[@"usr" stringByAppendingPathComponent:@"bin/"] isEqual:@"usr/bin"],
|
|
"'usr' stringByAppendingPathComponent: 'bin/'");
|
|
PASS([[@"usr" stringByAppendingPathComponent:@"/bin"] isEqual:@"usr/bin"],
|
|
"'usr' stringByAppendingPathComponent: '/bin'");
|
|
PASS([[@"usr" stringByAppendingPathComponent:@"/bin/"] isEqual:@"usr/bin"],
|
|
"'usr' stringByAppendingPathComponent: '/bin/'");
|
|
PASS([[@"/usr" stringByAppendingPathComponent:@""] isEqual:@"/usr"],
|
|
"'/usr' stringByAppendingPathComponent: ''");
|
|
PASS([[@"/usr" stringByAppendingPathComponent:@"bin"] isEqual:@"/usr/bin"],
|
|
"'/usr' stringByAppendingPathComponent: 'bin'");
|
|
PASS([[@"/usr" stringByAppendingPathComponent:@"bin/"] isEqual:@"/usr/bin"],
|
|
"'/usr' stringByAppendingPathComponent: 'bin/'");
|
|
PASS([[@"/usr" stringByAppendingPathComponent:@"/bin"] isEqual:@"/usr/bin"],
|
|
"'/usr' stringByAppendingPathComponent: '/bin'");
|
|
PASS([[@"/usr" stringByAppendingPathComponent:@"/bin/"] isEqual:@"/usr/bin"],
|
|
"'/usr' stringByAppendingPathComponent: '/bin/'");
|
|
PASS([[@"/usr/" stringByAppendingPathComponent:@""] isEqual:@"/usr"],
|
|
"'/usr/' stringByAppendingPathComponent: ''");
|
|
PASS([[@"/usr/" stringByAppendingPathComponent:@"bin"] isEqual:@"/usr/bin"],
|
|
"'/usr/' stringByAppendingPathComponent: 'bin'");
|
|
PASS([[@"/usr/" stringByAppendingPathComponent:@"bin/"] isEqual:@"/usr/bin"],
|
|
"'/usr/' stringByAppendingPathComponent: 'bin/'");
|
|
PASS([[@"/usr/" stringByAppendingPathComponent:@"/bin/"] isEqual:@"/usr/bin"],
|
|
"'/usr/' stringByAppendingPathComponent: '/bin/'");
|
|
[arp release]; arp = nil;
|
|
return 0;
|
|
}
|