Differences From Artifact [9ef8e91ce4]:
- File tests/OFStringTests.m — part of check-in [a51b3cb390] at 2011-10-31 22:02:09 on branch trunk — Add -[UTF16String] to OFString. (user: js, size: 20934) [annotate] [blame] [check-ins using]
To Artifact [6206f4255c]:
- File
tests/OFStringTests.m
— part of check-in
[301ee63212]
at
2011-11-20 18:41:25
on branch trunk
— Make OFString a class cluster.
It is a class cluster now, but there is still much to improve. (user: js, size: 21376) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
113 114 115 116 117 118 119 | TEST(@"-[appendString:] and -[appendUTF8String:]", R([s[1] appendUTF8String: "1𝄞"]) && R([s[1] appendString: @"3"]) && R([s[0] appendString: s[1]]) && [s[0] isEqual: @"täs€1𝄞3"]) TEST(@"-[length]", [s[0] length] == 7) TEST(@"-[UTF8StringLength]", [s[0] UTF8StringLength] == 13) | | | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | TEST(@"-[appendString:] and -[appendUTF8String:]", R([s[1] appendUTF8String: "1𝄞"]) && R([s[1] appendString: @"3"]) && R([s[0] appendString: s[1]]) && [s[0] isEqual: @"täs€1𝄞3"]) TEST(@"-[length]", [s[0] length] == 7) TEST(@"-[UTF8StringLength]", [s[0] UTF8StringLength] == 13) TEST(@"-[hash]", [s[0] hash] == 0x324B6743) TEST(@"-[characterAtIndex:]", [s[0] characterAtIndex: 0] == 't' && [s[0] characterAtIndex: 1] == 0xE4 && [s[0] characterAtIndex: 3] == 0x20AC && [s[0] characterAtIndex: 5] == 0x1D11E) EXPECT_EXCEPTION(@"Detect out of range in -[characterAtIndex:]", |
︙ | ︙ | |||
410 411 412 413 414 415 416 417 418 419 420 421 422 423 | [s[0] isEqual: @"𝄞ööäöüöbä€"]) EXPECT_EXCEPTION(@"Detect invalid encoding in -[stringByURLDecoding] " @"#1", OFInvalidEncodingException, [@"foo%bar" stringByURLDecoding]) EXPECT_EXCEPTION(@"Detect invalid encoding in -[stringByURLDecoding] " @"#2", OFInvalidEncodingException, [@"foo%FFbar" stringByURLDecoding]) TEST(@"-[deleteCharactersInRange:]", (s[0] = [OFMutableString stringWithString: @"𝄞öööbä€"]) && R([s[0] deleteCharactersInRange: of_range(1, 3)]) && [s[0] isEqual: @"𝄞bä€"] && R([s[0] deleteCharactersInRange: of_range(0, 4)]) && [s[0] isEqual: @""]) | > > > > > > > > > > > > > > > | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | [s[0] isEqual: @"𝄞ööäöüöbä€"]) EXPECT_EXCEPTION(@"Detect invalid encoding in -[stringByURLDecoding] " @"#1", OFInvalidEncodingException, [@"foo%bar" stringByURLDecoding]) EXPECT_EXCEPTION(@"Detect invalid encoding in -[stringByURLDecoding] " @"#2", OFInvalidEncodingException, [@"foo%FFbar" stringByURLDecoding]) TEST(@"-[setCharacter:atIndex:]", (s[0] = [OFMutableString stringWithString: @"abäde"]) && R([s[0] setCharacter: 0xF6 atIndex: 2]) && [s[0] isEqual: @"aböde"] && R([s[0] setCharacter: 'c' atIndex: 2]) && [s[0] isEqual: @"abcde"] && R([s[0] setCharacter: 0x20AC atIndex: 3]) && [s[0] isEqual: @"abc€e"] && R([s[0] setCharacter: 'x' atIndex: 1]) && [s[0] isEqual: @"axc€e"]) TEST(@"-[deleteCharactersInRange:]", (s[0] = [OFMutableString stringWithString: @"𝄞öööbä€"]) && R([s[0] deleteCharactersInRange: of_range(1, 3)]) && [s[0] isEqual: @"𝄞bä€"] && R([s[0] deleteCharactersInRange: of_range(0, 4)]) && [s[0] isEqual: @""]) |
︙ | ︙ |