mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Add another test that makes it easier to debug string errors.
This commit is contained in:
parent
e5fcc2fab9
commit
3f928e32ff
1 changed files with 17 additions and 0 deletions
|
@ -476,6 +476,23 @@ int main()
|
|||
res = [indianLong rangeOfString: indianShort options: NSCaseInsensitiveSearch|NSBackwardsSearch];
|
||||
PASS(NSNotFound == res.location, "unicode not found backwards insensitive")
|
||||
|
||||
for (int i=0 ; i<[indianLong length] ; i++)
|
||||
{
|
||||
PASS([ls characterAtIndex: i] == [indianLong characterAtIndex: i], "Characters match");
|
||||
NSRange r1 = [ls rangeOfComposedCharacterSequenceAtIndex: i];
|
||||
NSRange r2 = [indianLong rangeOfComposedCharacterSequenceAtIndex: i];
|
||||
PASS(r1.location == r2.location, "Composed characters start at the same place");
|
||||
PASS(r1.length == r2.length, "Composed characters have the same lengths");
|
||||
assert(r1.length < 5);
|
||||
unichar buf1[5];
|
||||
unichar buf2[5];
|
||||
[ls getCharacters: buf1 range: r1];
|
||||
[indianLong getCharacters: buf2 range: r2];
|
||||
for (int j=0 ; j<r1.length ; j++)
|
||||
{
|
||||
PASS(buf1[j] == buf2[j], "Characters match when accessed by range");
|
||||
}
|
||||
}
|
||||
res = [ls rangeOfString: indianLong options: 0];
|
||||
PASS(0 == res.location, "unicode found at start simple")
|
||||
res = [ls rangeOfString: indianLong options: NSCaseInsensitiveSearch];
|
||||
|
|
Loading…
Reference in a new issue