Differences From Artifact [c6f6b5b983]:
- File
tests/OFString/OFString.m
— part of check-in
[a29d403286]
at
2009-05-23 16:50:44
on branch trunk
— A few renames in OFArray, OFDataArray and OFDictionary.
OFArray:
* Rename - object: to - objectAtIndex:.OFDataArray:
* Rename - item: to - itemAtIndex:.OFDictionary:
* Rename - get: to - objectForKey:.
* Rename - set:to: to - setObject:forKey:.
* Rename - remove: to - removeObjectForKey:. (user: js, size: 3196) [annotate] [blame] [check-ins using]
To Artifact [41d0f6db68]:
- File tests/OFString/OFString.m — part of check-in [bc71bde0dd] at 2009-05-23 21:02:09 on branch trunk — Add replaceOccurrencesOfString:withString: to OFString. (user: js, size: 3478) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
21 22 23 24 25 26 27 | #ifndef _WIN32 #define ZD "%zd" #else #define ZD "%u" #endif | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #ifndef _WIN32 #define ZD "%zd" #else #define ZD "%u" #endif #define NUM_TESTS 27 #define SUCCESS \ printf("\r\033[1;%dmTests successful: " ZD "/%d\033[0m", \ (i == NUM_TESTS - 1 ? 32 : 33), i + 1, NUM_TESTS); \ fflush(stdout); #define FAIL \ printf("\r\033[K\033[1;31mTest " ZD "/%d failed!\033[m\n", \ i + 1, NUM_TESTS); \ |
︙ | ︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 | CHECK([[a objectAtIndex: j++] isEqual: @""]) CHECK([[a objectAtIndex: j++] isEqual: @""]) CHECK([[@"foo\"ba'_$" urlencode] isEqual: @"foo%22ba%27_%24"]) CHECK([[@"foo%20bar%22%24" urldecode] isEqual: @"foo bar\"$"]) CHECK_EXCEPT([@"foo%bar" urldecode], OFInvalidEncodingException) CHECK_EXCEPT([@"foo%FFbar" urldecode], OFInvalidEncodingException) puts(""); return 0; } | > > > > > > > > > | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | CHECK([[a objectAtIndex: j++] isEqual: @""]) CHECK([[a objectAtIndex: j++] isEqual: @""]) CHECK([[@"foo\"ba'_$" urlencode] isEqual: @"foo%22ba%27_%24"]) CHECK([[@"foo%20bar%22%24" urldecode] isEqual: @"foo bar\"$"]) CHECK_EXCEPT([@"foo%bar" urldecode], OFInvalidEncodingException) CHECK_EXCEPT([@"foo%FFbar" urldecode], OFInvalidEncodingException) s1 = [@"asd fo asd fofo asd" mutableCopy]; [s1 replaceOccurrencesOfString: @"fo" withString: @"foo"]; CHECK([s1 isEqual: @"asd foo asd foofoo asd"]) s1 = [@"XX" mutableCopy]; [s1 replaceOccurrencesOfString: @"X" withString: @"XX"]; CHECK([s1 isEqual: @"XXXX"]) puts(""); return 0; } |