Changed unchecked::next to match utf8::match. The functionality should remain the same.
git-svn-id: http://svn.code.sf.net/p/utfcpp/code@24 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
parent
ad118a86e7
commit
1e17f800fe
1 changed files with 28 additions and 0 deletions
|
@ -27,7 +27,21 @@ int main()
|
||||||
assert (cp == 0x65e5);
|
assert (cp == 0x65e5);
|
||||||
assert (w == twochars + 3);
|
assert (w == twochars + 3);
|
||||||
|
|
||||||
|
unsigned char threechars[] = {0xf0, 0x90, 0x8d, 0x86, 0xe6, 0x97, 0xA5, 0xd1, 0x88, 0x0};
|
||||||
|
w = threechars;
|
||||||
|
cp = next(w, threechars + 9);
|
||||||
|
assert (cp == 0x10346);
|
||||||
|
assert (w == threechars + 4);
|
||||||
|
cp = next(w, threechars + 9);
|
||||||
|
assert (cp == 0x65e5);
|
||||||
|
assert (w == threechars + 7);
|
||||||
|
cp = next(w, threechars + 9);
|
||||||
|
assert (cp == 0x0448);
|
||||||
|
assert (w == threechars + 9);
|
||||||
|
|
||||||
|
|
||||||
//previous
|
//previous
|
||||||
|
w = twochars + 3;
|
||||||
cp = previous (w, twochars - 1);
|
cp = previous (w, twochars - 1);
|
||||||
assert (cp == 0x65e5);
|
assert (cp == 0x65e5);
|
||||||
assert (w == twochars);
|
assert (w == twochars);
|
||||||
|
@ -104,6 +118,20 @@ int main()
|
||||||
assert (cp == 0x65e5);
|
assert (cp == 0x65e5);
|
||||||
assert (w == twochars + 3);
|
assert (w == twochars + 3);
|
||||||
|
|
||||||
|
w = threechars;
|
||||||
|
cp = unchecked::next(w);
|
||||||
|
assert (cp == 0x10346);
|
||||||
|
assert (w == threechars + 4);
|
||||||
|
cp = unchecked::next(w);
|
||||||
|
assert (cp == 0x65e5);
|
||||||
|
assert (w == threechars + 7);
|
||||||
|
cp = unchecked::next(w);
|
||||||
|
assert (cp == 0x0448);
|
||||||
|
assert (w == threechars + 9);
|
||||||
|
|
||||||
|
|
||||||
|
//previous
|
||||||
|
w = twochars + 3;
|
||||||
//previous
|
//previous
|
||||||
cp = unchecked::previous (w);
|
cp = unchecked::previous (w);
|
||||||
assert (cp == 0x65e5);
|
assert (cp == 0x65e5);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue