From e034abef822024f13221d18aec9249384ef2650e Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 3 Mar 2010 20:38:56 -0800 Subject: [PATCH] Add a test for the initWithItems:copy: fix. --- Tests/Foundation/CPArrayTest.j | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Tests/Foundation/CPArrayTest.j b/Tests/Foundation/CPArrayTest.j index 04ea56486..f195d99f8 100644 --- a/Tests/Foundation/CPArrayTest.j +++ b/Tests/Foundation/CPArrayTest.j @@ -155,6 +155,14 @@ } } +- (void)testInitWithArrayCopyItems +{ + var a = [[CopyableObject new], 2, 3]; + var b = [[CPArray alloc] initWithArray:a copyItems:YES]; + + [self assert:a notEqual:b]; +} + @end @implementation CPArray (reverse) @@ -169,3 +177,14 @@ } @end + +@implementation CopyableObject : CPObject +{ +} + +- (id)copy +{ + return [[[self class] alloc] init]; +} + +@end