PageRenderTime 39ms CodeModel.GetById 14ms app.highlight 10ms RepoModel.GetById 2ms app.codeStats 0ms

/Tests/Foundation/CPStringTest.j

http://github.com/cacaodev/cappuccino
Unknown | 582 lines | 494 code | 88 blank | 0 comment | 0 complexity | 5014ff6740b36ea988c97bee2ccd9030 MD5 | raw file
  1@import <Foundation/CPString.j>
  2@import <Foundation/CPCharacterSet.j>
  3
  4@implementation CPStringTest : OJTestCase
  5
  6
  7- (void)testStringByReplacingOccurrencesOfStringWithString
  8{
  9    var expectedString = @"hello world. A new world!",
 10        dummyString = @"hello woold. A new woold!",
 11        actualString = [dummyString stringByReplacingOccurrencesOfString:@"woold" withString:@"world"];
 12
 13    [self assertTrue:(expectedString === actualString)
 14             message:"stringByAppendingFormat: expected:" + expectedString + " actual:" + actualString];
 15}
 16
 17- (void)testStringByReplacingWithRegexCharacters
 18{
 19    var stringToTest = "${foo} {foo}",
 20        result = [stringToTest stringByReplacingOccurrencesOfString:"${foo}" withString:"BAR"];
 21
 22    [self assert:result equals:"BAR {foo}"];
 23}
 24
 25- (void)testStringByAppendingFormat
 26{
 27    var format = @"%d X %d = %d",
 28        expectedString = "2 X 3 = 6",
 29        dummyString = @"",
 30        actualString = [dummyString stringByAppendingFormat:format, 2, 3, 6];
 31
 32    [self assertTrue:(expectedString === actualString)
 33             message:"stringByAppendingFormat: expected:" + expectedString + " actual:" + actualString];
 34}
 35
 36- (void)testStringWithString
 37{
 38    var original = [[CPString alloc] initWithString:"str"],
 39        copy = [CPString stringWithString:original];
 40
 41    [self assertTrue:(original == copy) message:"Contents should be equal"];
 42}
 43
 44- (void)testInitWithString
 45{
 46    var str = [[CPString alloc] initWithString:"str"];
 47    [self assert:"str" equals:str];
 48}
 49
 50- (void)testInitWithFormat
 51{
 52    // this could be really big
 53    var str = [[CPString alloc] initWithFormat:"%s", "str"];
 54    [self assert:"str" equals:str];
 55
 56    str = [[CPString alloc] initWithFormat:"%d", 42];
 57    [self assert:"42" equals:str];
 58
 59    str = [[CPString alloc] initWithFormat:"%f", 42.2];
 60    [self assert:"42.2" equals:str];
 61}
 62
 63- (void)testStringWithFormat
 64{
 65    // this could be equally big
 66    var str = [CPString stringWithFormat:"%s", "str"];
 67    [self assert:"str" equals:str];
 68
 69    str = [CPString stringWithFormat:"%d", 42];
 70    [self assert:"42" equals:str];
 71
 72    str = [CPString stringWithFormat:"%f", 42.2];
 73    [self assert:"42.2" equals:str];
 74}
 75
 76- (void)testLength
 77{
 78    [self assert:0 equals:["" length]];
 79    [self assert:1 equals:["a" length]];
 80    [self assert:5 equals:["abcde" length]];
 81    [self assert:3 equals:["日本語" length]];
 82}
 83
 84- (void)testCharacterAtIndex
 85{
 86    [self assert:"a" equals:["abcd" characterAtIndex:0]];
 87    [self assert:"b" equals:["abcd" characterAtIndex:1]];
 88    [self assert:"d" equals:["abcd" characterAtIndex:3]];
 89    [self assert:"語" equals:["日本語" characterAtIndex:2]];
 90}
 91
 92- (void)testStringByAppendingSting
 93{
 94    [self assert:"onetwo" equals:["one" stringByAppendingString:"two"]];
 95}
 96
 97
 98- (void)testStringByPaddingToLength
 99{
100    [self assert:"onebcd"
101          equals:["one" stringByPaddingToLength:6
102                                     withString:"abcdefg"
103                                startingAtIndex:1]];
104}
105
106- (void)testComponentsSeparatedByString
107{
108    [self assert:["arash", "francisco", "ross", "tom"]
109          equals:["arash.francisco.ross.tom" componentsSeparatedByString:"."]];
110}
111
112- (void)testSubstringFromIndex
113{
114    [self assert:"abcd" equals:["abcd" substringFromIndex:0]];
115    [self assert:"bcd"  equals:["abcd" substringFromIndex:1]];
116    [self assert:""     equals:["abcd" substringFromIndex:4]];
117}
118
119- (void)testSubstringWithRange
120{
121    [self assert:"bcd"   equals:["abcde" substringWithRange:CPMakeRange(1,3)]];
122    [self assert:"abcde" equals:["abcde" substringWithRange:CPMakeRange(0,5)]];
123    [self assert:""      equals:["abcde" substringWithRange:CPMakeRange(1,0)]];
124}
125
126- (void)testSubstringToIndex
127{
128    [self assert:"abcd" equals:["abcd" substringToIndex:4]];
129    [self assert:"abc"  equals:["abcd" substringToIndex:3]];
130    [self assert:""     equals:["abcd" substringToIndex:0]];
131
132    var sawException = false;
133    try
134    {
135        [@"abcd" substringToIndex:5];
136    }
137    catch (anException)
138    {
139        sawException = true;
140        [self assert:CPRangeException equals:[anException name]];
141    }
142    [self assertTrue:sawException message:"expected CPRangeException"];
143}
144
145- (void)testBoolValue
146{
147    var testStrings = [
148            ["  090",  YES],
149            ["  YES",  YES],
150            ["  true", YES],
151            ["  True", YES],
152            ["  tTR",  YES],
153            ["  +98",  YES],
154            ["  -98",  YES],
155            ["  +08",  YES],
156            ["  -98",  YES],
157            ["  NO",    NO],
158            ["  -N00",  NO],
159            ["  00",    NO],
160            ["  -00",   NO],
161            ["  -+001", NO],
162        ];
163
164    for (var i = 0; i < testStrings.length; i++)
165        [self assert:[testStrings[i][0] boolValue] equals:testStrings[i][1]];
166}
167
168- (void)testCommonPrefixWithString
169{
170    var testStringsCase = [
171            ["Hello", "Helicopter", "Hel"],
172            ["Tester", "Taser", "T"],
173            ["Abcd", "Abcd", "Abcd"],
174            ["A long string", "A longer string", "A long"]
175        ];
176
177    var testStringsCaseless = [
178            ["hElLo", "HeLiCoPtEr", "hEl"],
179            ["tEsTeR", "TaSeR", "t"],
180            ["aBcD", "AbCd", "aBcD"],
181            ["a LoNg StRiNg", "A lOnGeR sTrInG", "a LoNg"]
182        ];
183
184    for (var i = 0; i < testStringsCase.length; i++)
185        [self assert: [testStringsCase[i][0] commonPrefixWithString:testStringsCase[i][1]]
186              equals: testStringsCase[i][2]];
187
188    for (var i = 0; i < testStringsCaseless.length; i++)
189        [self assert: [testStringsCaseless[i][0] commonPrefixWithString: testStringsCaseless[i][1]
190                                                 options: CPCaseInsensitiveSearch]
191              equals: testStringsCaseless[i][2]];
192}
193
194- (void)testCapitalizedString
195{
196    var testStrings = [
197            ["", ""],
198            ["hElLo wOrLd", "Hello World"],
199            [" monkey-Cow", " Monkey-cow"],
200            ["tHe QuicK bRowN-Fox JumPed_Over +the LaZy%dog", "The Quick Brown-fox Jumped_over +the Lazy%dog"]
201        ];
202
203    for (var i = 0; i < testStrings.length; i++)
204        [self assert:[testStrings[i][0] capitalizedString] equals:testStrings[i][1]];
205}
206
207- (void)testUppercaseString
208{
209    var str = "This is a test";
210    [self assert:[str uppercaseString] equals:"THIS IS A TEST"];
211}
212
213- (void)testLowercaseString
214{
215    var str = "This Is A TEST";
216    [self assert:"this is a test" equals:[str lowercaseString]];
217}
218
219- (void)testStringWithHash
220{
221    [self assert:"000000" equals:[CPString stringWithHash:0]];
222    [self assert:"000001" equals:[CPString stringWithHash:1]];
223    [self assert:"00000a" equals:[CPString stringWithHash:10]];
224    [self assert:"000010" equals:[CPString stringWithHash:16]];
225    [self assert:"ffffff" equals:[CPString stringWithHash:16777215]];
226}
227
228- (void)testStringByAppendingPathComponent
229{
230    var testStrings = [
231            ["/tmp/", "scratch.tiff", "/tmp/scratch.tiff"],
232            ["/tmp///", "scratch.tiff", "/tmp/scratch.tiff"],
233            ["/tmp///", "///scratch.tiff", "/tmp/scratch.tiff"],
234            ["/tmp", "scratch.tiff", "/tmp/scratch.tiff"],
235            ["/tmp///", "scratch.tiff", "/tmp/scratch.tiff"],
236            ["/tmp///", "///scratch.tiff", "/tmp/scratch.tiff"],
237            ["/", "scratch.tiff", "/scratch.tiff"],
238            ["", "scratch.tiff", "scratch.tiff"],
239            ["", "", ""],
240            ["", "/", ""],
241            ["/", "/", "/"],
242            ["/tmp", nil, "/tmp"],
243            ["/tmp", "/", "/tmp"],
244            ["/tmp/", "", "/tmp"]
245        ];
246
247    for (var i = 0; i < testStrings.length; i++)
248    {
249        var result = [testStrings[i][0] stringByAppendingPathComponent:testStrings[i][1]];
250
251        [self assertTrue:result === testStrings[i][2] message:"Value <" + testStrings[i][0] + "> Adding <" + testStrings[i][1] + "> Expected <" + testStrings[i][2] + "> was <" + result + ">"];
252    }
253}
254
255- (void)testStringByAppendingPathExtension
256{
257    var testStrings = [
258            ["/tmp/scratch.old", "tiff", "/tmp/scratch.old.tiff"],
259            ["/tmp/scratch.", "tiff", "/tmp/scratch..tiff"],
260            ["/tmp///", "tiff", "/tmp.tiff"],
261            ["scratch", "tiff", "scratch.tiff"],
262            ["/", "tiff", "/"],
263            ["", "tiff", ""]
264        ];
265
266    for (var i = 0; i < testStrings.length; i++)
267    {
268        var result = [testStrings[i][0] stringByAppendingPathExtension:testStrings[i][1]];
269
270        [self assertTrue:result === testStrings[i][2] message:"Value <" + testStrings[i][0] + "> Adding <" + testStrings[i][1] + "> Expected <" + testStrings[i][2] + "> was <" + result + ">"];
271    }
272}
273
274- (void)testStringByDeletingLastPathComponent
275{
276    var testStrings = [
277            ["/tmp/scratch.tiff", "/tmp"],
278            ["/tmp/lock/", "/tmp"],
279            ["/tmp/", "/"],
280            ["/tmp", "/"],
281            ["/", "/"],
282            ["scratch.tiff", ""],
283            ["a/b/c/d//////",  "a/b/c"],
284            ["a/b/////////c/d//////",  "a/b/c"],
285            ["a/b/././././c/d/./././", "a/b/././././c/d/./."],
286            [@"a/b/././././d////", "a/b/./././."],
287            [@"~/a", "~"],
288            [@"~/a/", "~"],
289            [@"../../", ".."],
290            [@"", ""]
291        ];
292
293    for (var i = 0; i < testStrings.length; i++)
294    {
295        var result = [testStrings[i][0] stringByDeletingLastPathComponent];
296
297        [self assertTrue:result === testStrings[i][1] message:"Value <" + testStrings[i][0] + "> Expected <" + testStrings[i][1] + "> was <" + result + ">"];
298    }
299}
300
301- (void)testPathWithComponents
302{
303    var testStrings = [
304            [["tmp", "scratch"], "tmp/scratch"],
305            [["/", "tmp", "scratch"], "/tmp/scratch"],
306            [["/", "tmp", "/", "scratch"], "/tmp/scratch"],
307            [["/", "tmp", "scratch", "/"], "/tmp/scratch"],
308            [["/", "tmp", "scratch", ""], "/tmp/scratch"],
309            [["", "/tmp", "scratch", ""], "/tmp/scratch"],
310            [["", "tmp", "scratch", ""], "tmp/scratch"],
311            [["/"], "/"],
312            [["/", "/", "/"], "/"],
313            [["", "", ""], ""],
314            [[""], ""]
315        ];
316
317    for (var i = 0; i < testStrings.length; i++)
318    {
319        var result = [CPString pathWithComponents:testStrings[i][0]];
320
321        [self assertTrue:result === testStrings[i][1] message:"Value <" + testStrings[i][0] + "> Expected [" + testStrings[i][1] + "] was [" + result + "]"];
322    }
323}
324
325- (void)testPathComponents
326{
327    var testStrings = [
328            ["tmp/scratch", ["tmp", "scratch"]],
329            ["/tmp/scratch", ["/", "tmp", "scratch"]],
330            ["/tmp/scratch/", ["/", "tmp", "scratch", "/"]],
331            ["/tmp/", ["/", "tmp", "/"]],
332            ["/////tmp/////scratch///", ["/", "tmp", "scratch", "/"]],
333            ["scratch.tiff", ["scratch.tiff"]],
334            ["/", ["/"]],
335            ["", [""]]
336        ];
337
338    for (var i = 0; i < testStrings.length; i++)
339    {
340        var result = [testStrings[i][0] pathComponents];
341
342        [self assertTrue:[result isEqualToArray:testStrings[i][1]] message:"Expected [" + testStrings[i][1] + "] was [" + result + "]"];
343    }
344}
345
346- (void)testLastPathComponent
347{
348    var testStrings = [
349            ["/tmp/scratch.tiff", "scratch.tiff"],
350            ["/tmp/scratch", "scratch"],
351            ["/tmp/", "tmp"],
352            ["scratch", "scratch"],
353            ["/", "/"],
354            ["", ""]
355        ];
356
357    for (var i = 0; i < testStrings.length; i++)
358        [self assert:testStrings[i][1] equals:[testStrings[i][0] lastPathComponent]];
359}
360
361- (void)testPathExtension
362{
363    var testStrings = [
364            ["/tmp/scratch.tiff", "tiff"],
365            ["scratch.png", "png"],
366            ["/tmp/scratch..tiff", "tiff"],
367            ["/tmp", ""],
368            ["scratch", ""],
369        ];
370
371    for (var i = 0; i < testStrings.length; i++)
372        [self assert:testStrings[i][1] equals:[testStrings[i][0] pathExtension]];
373}
374
375- (void)testStringByDeletingPathExtension
376{
377    var testStrings = [
378            ["/tmp/scratch.tiff", "/tmp/scratch"],
379            ["scratch.png", "scratch"],
380            ["/tmp/scratch..tiff", "/tmp/scratch."],
381            ["/tmp", "/tmp"],
382            [".tiff", ".tiff"],
383            ["/", "/"],
384        ];
385
386    for (var i = 0; i < testStrings.length; i++)
387        [self assert:testStrings[i][1] equals:[testStrings[i][0] stringByDeletingPathExtension]];
388}
389
390- (void)testHasPrefix
391{
392    [self assertTrue: ["abc" hasPrefix:"a"]];
393    [self assertTrue: ["abc" hasPrefix:"ab"]];
394    [self assertTrue: ["abc" hasPrefix:"abc"]];
395    [self assertFalse:["abc" hasPrefix:"abcd"]];
396    [self assertFalse:["abc" hasPrefix:"dbc"]];
397    [self assertFalse:["abc" hasPrefix:"bc"]];
398    [self assertFalse:["abc" hasPrefix:"c"]];
399    [self assertFalse:["abc" hasPrefix:""]];
400}
401
402- (void)testHasSuffix
403{
404    [self assertTrue: ["abc" hasSuffix:"c"]];
405    [self assertTrue: ["abc" hasSuffix:"bc"]];
406    [self assertTrue: ["abc" hasSuffix:"abc"]];
407    [self assertFalse:["abc" hasSuffix:"abcd"]];
408    [self assertFalse:["abc" hasSuffix:"ab"]];
409    [self assertFalse:["abc" hasSuffix:"b"]];
410    [self assertFalse:["abc" hasSuffix:"cat"]];
411    [self assertFalse:["abc" hasSuffix:""]];
412}
413
414- (void)testComponentsSeparatedByCharactersInSetEmptyString
415{
416    [self assert:[""]
417          equals:["" componentsSeparatedByCharactersInSet:[CPCharacterSet whitespaceCharacterSet]]];
418}
419
420- (void)testComponentsSeparatedByCharactersInSetStringWithoutCharactersFromSet
421{
422    [self assert:["Abradab"]
423          equals:["Abradab" componentsSeparatedByCharactersInSet:[CPCharacterSet whitespaceCharacterSet]]];
424}
425
426- (void)testComponentsSeparatedByCharactersInSet
427{
428    [self assert:["Baku", "baku", "to", "jest", "", "skład."]
429          equals:["Baku baku to jest  skład." componentsSeparatedByCharactersInSet:[CPCharacterSet whitespaceCharacterSet]]];
430}
431
432- (void)testComponentsSeparatedByCharactersInSetLeadingAndTrailingCharacterFromSet
433{
434    [self assert:["", "Test", ""]
435          equals:[" Test " componentsSeparatedByCharactersInSet:[CPCharacterSet whitespaceCharacterSet]]];
436}
437
438- (void)testComponentsSeparatedByCharactersExceptionRaiseOnNilSeparator
439{
440    try
441    {
442        [[CPString string] componentsSeparatedByCharactersInSet:nil];
443        [self assert:false];
444    }
445    catch (anException)
446    {
447        [self assert:[anException name] equals:CPInvalidArgumentException];
448        [self assert:[anException reason] equals:@"componentsSeparatedByCharactersInSet: the separator can't be 'nil'"];
449    }
450}
451
452- (void)testIsEqual
453{
454    var str = "s";
455    [self assert:str equals:[CPString stringWithString:str]];
456    [self assert:str equals:[str copy]];
457    [self assert:[str copy] equals:str];
458    [self assert:[str copy] equals:[str copy]];
459}
460
461- (void)testRangeOfString
462{
463    // Based on the Cocoa "String Programming Guide" example.
464    var searchString = @"age",
465        beginsTest = @"Agencies",
466        prefixRange = [beginsTest rangeOfString:searchString options:(CPCaseInsensitiveSearch)];
467
468    [self assert:0 equals:prefixRange.location message:@"forward search for age (location)"];
469    [self assert:3 equals:prefixRange.length message:@"forward search for age (length)"];
470
471    var endsTest = @"BRICOLAGE",
472        suffixRange = [endsTest rangeOfString:searchString options:(CPCaseInsensitiveSearch | CPBackwardsSearch)];
473
474    [self assert:6 equals:suffixRange.location message:@"backwards search for age (location)"];
475    [self assert:3 equals:suffixRange.length message:@"backwards search for age (length)"];
476}
477
478- (void)testRangeOfString_Anchored_Backwards
479{
480    var endsTest = @"AGEBRICOLAGE",
481        unAnchoredSuffixRange = [endsTest rangeOfString:@"LAG" options:(CPCaseInsensitiveSearch | CPBackwardsSearch)],
482        anchoredSuffixRange = [endsTest rangeOfString:@"LAG" options:(CPAnchoredSearch | CPCaseInsensitiveSearch | CPBackwardsSearch)];
483
484    [self assert:8 equals:unAnchoredSuffixRange.location message:"backwards search for LAG"];
485    [self assert:CPNotFound equals:anchoredSuffixRange.location message:"anchored backwards search for LAG"];
486
487    anchoredSuffixRange = [endsTest rangeOfString:@"AGE" options:(CPAnchoredSearch | CPCaseInsensitiveSearch | CPBackwardsSearch)];
488    [self assert:9 equals:anchoredSuffixRange.location message:"anchored backwards search for AGE"];
489
490    anchoredSuffixRange = [endsTest rangeOfString:endsTest options:(CPAnchoredSearch | CPCaseInsensitiveSearch | CPBackwardsSearch)];
491    [self assert:0 equals:anchoredSuffixRange.location message:"anchored backwards search for whole string (location)"];
492    [self assert:endsTest.length equals:anchoredSuffixRange.length message:"anchored backwards search for whole string (length)"];
493
494    anchoredSuffixRange = [endsTest rangeOfString:@"" options:(CPAnchoredSearch | CPCaseInsensitiveSearch | CPBackwardsSearch)];
495    [self assert:CPNotFound equals:anchoredSuffixRange.location message:"anchored backwards search for nothing (location)"];
496    [self assert:0 equals:anchoredSuffixRange.length message:"anchored backwards search for nothing (length)"];
497}
498
499- (void)testRangeOfString_options_range
500{
501    var testString = @"In another life you would have made a excellent criminal.",
502        hitRange;
503
504    hitRange = [testString rangeOfString:@"life" options:0 range:CPMakeRange(0, testString.length)];
505    [self assert:11 equals:hitRange.location message:@"search for 'life' in full range (location)"];
506    [self assert:4 equals:hitRange.length message:@"search for 'life' in full range (position)"];
507
508    hitRange = [testString rangeOfString:@"i" options:0 range:CPMakeRange(0, testString.length)];
509    [self assert:12 equals:hitRange.location message:@"search for 'i' in full range (location)"];
510    [self assert:1 equals:hitRange.length message:@"search for 'i' in full range (position)"];
511
512    hitRange = [testString rangeOfString:@"i" options:0 range:CPMakeRange(10, 20)];
513    [self assert:12 equals:hitRange.location message:@"search for 'i' in partial range (location)"];
514    [self assert:1 equals:hitRange.length message:@"search for 'i' in partial range (position)"];
515
516    var sawException = false;
517    try
518    {
519        hitRange = [testString rangeOfString:@"i" options:0 range:CPMakeRange(50, 60)];
520    }
521    catch (anException)
522    {
523        sawException = true;
524        [self assert:CPRangeException equals:[anException name]];
525    }
526    [self assertTrue:sawException message:"expected CPRangeException"];
527}
528
529- (void)testStringByTrimmingCharactersInSet
530{
531    var startOneString = @".This is a test startOne",
532        startManyString = @".,.This is a test startMany",
533        endOneString = @"This is a test endOne.",
534        endManyString = @"This is a test endMany.,.",
535        bothOneString = @".This is a test bothOne,",
536        bothManyString = @".,,This is a test bothMany..,",
537        noneString = @"This is a test none",
538        set = [CPCharacterSet characterSetWithCharactersInString:@".,"];
539
540    [self assert:"This is a test startOne" equals:[startOneString stringByTrimmingCharactersInSet:set]];
541    [self assert:"This is a test startMany" equals:[startManyString stringByTrimmingCharactersInSet:set]];
542    [self assert:"This is a test endOne" equals:[endOneString stringByTrimmingCharactersInSet:set]];
543    [self assert:"This is a test endMany" equals:[endManyString stringByTrimmingCharactersInSet:set]];
544    [self assert:"This is a test bothOne" equals:[bothOneString stringByTrimmingCharactersInSet:set]];
545    [self assert:"This is a test bothMany" equals:[bothManyString stringByTrimmingCharactersInSet:set]];
546    [self assert:"This is a test none" equals:[noneString stringByTrimmingCharactersInSet:set]];
547}
548
549- (void)testStringByTrimmingWhitespace
550{
551    var startOneString = @" This is a test startOne",
552        startManyString = @"   This is a test startMany",
553        endOneString = @"This is a test endOne ",
554        endManyString = @"This is a test endMany   ",
555        bothOneString = @" This is a test bothOne ",
556        bothManyString = @"   This is a test bothMany   ",
557        noneString = @"This is a test none",
558        set = [CPCharacterSet characterSetWithCharactersInString:@" "];
559
560    [self assert:"This is a test startOne" equals:[startOneString stringByTrimmingCharactersInSet:set]];
561    [self assert:"This is a test startMany" equals:[startManyString stringByTrimmingCharactersInSet:set]];
562    [self assert:"This is a test endOne" equals:[endOneString stringByTrimmingCharactersInSet:set]];
563    [self assert:"This is a test endMany" equals:[endManyString stringByTrimmingCharactersInSet:set]];
564    [self assert:"This is a test bothOne" equals:[bothOneString stringByTrimmingCharactersInSet:set]];
565    [self assert:"This is a test bothMany" equals:[bothManyString stringByTrimmingCharactersInSet:set]];
566    [self assert:"This is a test none" equals:[noneString stringByTrimmingCharactersInSet:set]];
567}
568
569- (void)testCompareWithNil
570{
571    [self assert:CPOrderedDescending equals:[@"Objective-J" compare:nil]];
572    [self assertThrows:function () { [@"Objective-J" compare:[CPNull null]] }];
573}
574
575- (void)testStripDiacritics
576{
577    [self assert:[@"áa ée íi óo úu" stripDiacritics]  equals:@"aa ee ii oo uu"];
578    [self assert:[@"ÁA ÉE ÍI ÓO ÚU" stripDiacritics]  equals:@"AA EE II OO UU"];
579    [self assert:[@"Å Ã Ê í ö û" stripDiacritics]  equals:@"A A E i o u"];
580}
581
582@end