149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
@"last", @"qux", @"Baz", @"Bar", @"Foo", nil])])
m[1] = [[a[0] mutableCopy] autorelease];
[m[1] addObject: @"0"];
[m[1] addObject: @"z"];
TEST(@"-[sortedArray]",
[[m[1] sortedArray] isEqual: ([OFArray arrayWithObjects:
@"0", @"Bar", @"Baz", @"Foo", @"z", nil])])
EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]])
EXPECT_EXCEPTION(@"Detect out of range in -[removeObjectsInRange:]",
OFOutOfRangeException, [m[0] removeObjectsInRange:
of_range(0, [m[0] count] + 1)])
|
|
>
>
>
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
@"last", @"qux", @"Baz", @"Bar", @"Foo", nil])])
m[1] = [[a[0] mutableCopy] autorelease];
[m[1] addObject: @"0"];
[m[1] addObject: @"z"];
TEST(@"-[sortedArray]",
[[m[1] sortedArray] isEqual: ([OFArray arrayWithObjects:
@"0", @"Bar", @"Baz", @"Foo", @"z", nil])] &&
[[m[1] sortedArrayWithOptions: OF_SORT_OPTIONS_DESCENDING]
isEqual: ([OFArray arrayWithObjects:
@"z", @"Foo", @"Baz", @"Bar", @"0", nil])])
EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]])
EXPECT_EXCEPTION(@"Detect out of range in -[removeObjectsInRange:]",
OFOutOfRangeException, [m[0] removeObjectsInRange:
of_range(0, [m[0] count] + 1)])
|