File: test01.m

package info (click to toggle)
gnustep-base 1.31.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,580 kB
  • sloc: objc: 239,446; ansic: 36,519; cpp: 122; sh: 112; makefile: 100; xml: 32
file content (71 lines) | stat: -rw-r--r-- 4,224 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#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;
}