@@ -115,11 +115,11 @@ 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] == 0xD576830E) + 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) @@ -412,10 +412,25 @@ 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ä€"] &&