From dfbf07b10c4cc54befa24cc434a418e541e99cb8 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Tue, 2 Sep 2025 15:44:39 +0300 Subject: [PATCH] fixed: test suite --- Tests/Foundation/CPMapTableTest.j | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Tests/Foundation/CPMapTableTest.j b/Tests/Foundation/CPMapTableTest.j index 98fc4b510..085bcd709 100644 --- a/Tests/Foundation/CPMapTableTest.j +++ b/Tests/Foundation/CPMapTableTest.j @@ -88,13 +88,15 @@ [self assertNull:[map_table objectForKey:@"key2"]]; } -- (void)testKeyEnumerator +- (void)testKeyEnumeratorOnEmptyMap { - // Test empty case by creating a new enumerator for each assertion + [self assert:[map_table count] equals:0 message:@"Pre-condition failed: map should be empty."]; [self assertNull:[[map_table keyEnumerator] nextObject]]; [self assert:[[[map_table keyEnumerator] allObjects] count] equals:0]; +} - // Add objects and test populated case +- (void)testKeyEnumeratorOnPopulatedMap +{ [map_table setObject:@"value1" forKey:@"key1"]; [map_table setObject:@"value2" forKey:123]; [map_table setObject:@"value3" forKey:objectKey]; @@ -107,13 +109,15 @@ [self assertTrue:[allKeys containsObject:objectKey]]; } -- (void)testObjectEnumerator +- (void)testObjectEnumeratorOnEmptyMap { - // Test empty case by creating a new enumerator for each assertion + [self assert:[map_table count] equals:0 message:@"Pre-condition failed: map should be empty."]; [self assertNull:[[map_table objectEnumerator] nextObject]]; [self assert:[[[map_table objectEnumerator] allObjects] count] equals:0]; +} - // Add objects and test populated case +- (void)testObjectEnumeratorOnPopulatedMap +{ [map_table setObject:@"value1" forKey:@"key1"]; [map_table setObject:@"value2" forKey:123]; [map_table setObject:@"value3" forKey:objectKey];