From d39bcfb7bd780c7db7b301961ffcf7e714c95255 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sun, 29 Mar 2015 13:16:51 +0100 Subject: [PATCH] Tests: new nil exception test for CPDictionary. --- Tests/Foundation/CPDictionaryTest.j | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/Foundation/CPDictionaryTest.j b/Tests/Foundation/CPDictionaryTest.j index f14dce9b0..5cdd75983 100644 --- a/Tests/Foundation/CPDictionaryTest.j +++ b/Tests/Foundation/CPDictionaryTest.j @@ -419,7 +419,7 @@ - (void)testInitWithObjectsAndKeys { - var dict = [[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", nil, @"Key2", @"Value3", @"Key3"]; + var dict = [[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", @"Value3", @"Key3"]; [self assert:2 equals:[dict count]]; [self assert:@"Value1" equals:[dict objectForKey:@"Key1"]]; @@ -427,6 +427,13 @@ [self assert:@"Value3" equals:[dict objectForKey:@"Key3"]]; } +- (void)testInitWithObjectsAndKeysAndNilValueShouldThrowException +{ + [self assertThrows:function () { + [[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", nil, @"Key2", @"Value3", @"Key3"] + }]; +} + - (void)testDictionaryLiteral { var dict = @{