mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-12 19:47:07 +00:00
Make sure -[CPArrayController arrangedObjects] always has a non-nil value.
This commit is contained in:
1 parent
e1d45fd385
commit
abce41d6fd
2 files changed
+19
-1
No files matched your search
@@ -136,7 +136,7 @@
|
||||
_sortDescriptors = [CPArray array];
|
||||
_filterPredicate = nil;
|
||||
_selectionIndexes = [CPIndexSet indexSet];
|
||||
_arrangedObjects = nil;
|
||||
_arrangedObjects = [CPArray array];
|
||||
}
|
||||
|
||||
- (void)prepareContent
|
||||
|
||||
@@ -56,6 +56,24 @@
|
||||
[self assert:object equals:[[arrayController arrangedObjects] objectAtIndex:1]];
|
||||
}
|
||||
|
||||
- (void)testAddObjectUpdatesArrangedObjectsWithoutSortDescriptors
|
||||
{
|
||||
var arrayController = [[CPArrayController alloc] init];
|
||||
|
||||
[arrayController addObject:@"content"];
|
||||
[self assert:[@"content"] equals:[arrayController content]];
|
||||
[self assert:[@"content"] equals:[arrayController arrangedObjects]];
|
||||
}
|
||||
|
||||
- (void)testInsertObjectUpdatesArrangedObjectsWithoutSortDescriptors
|
||||
{
|
||||
var arrayController = [[CPArrayController alloc] init];
|
||||
|
||||
[arrayController insertObject:@"content" atArrangedObjectIndex:0];
|
||||
[self assert:[@"content"] equals:[arrayController content]];
|
||||
[self assert:[@"content"] equals:[arrayController arrangedObjects]];
|
||||
}
|
||||
|
||||
- (void)testSelectPrevious
|
||||
{
|
||||
var arrayController = [self arrayController];
|
||||
|
||||
Reference in new issue
Block a user