mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
add test cases for new isutf8 checks
This commit is contained in:
parent
a0429ccf05
commit
8f4dc5a2af
1 changed files with 10 additions and 4 deletions
|
@ -46,6 +46,12 @@ TEST(isutf8, bad) {
|
|||
ASSERT_FALSE(isutf8("\200\300", -1)); // latin1 c1 control code
|
||||
ASSERT_FALSE(isutf8("\300\300", -1)); // missing continuation
|
||||
ASSERT_FALSE(isutf8("\377\200\200\200\200", -1)); // thompson-pike varint
|
||||
ASSERT_FALSE(isutf8("\355\240\200", -1)); // single utf-16 surrogate (high)
|
||||
ASSERT_FALSE(isutf8("\355\277\277", -1)); // single utf-16 surrogate (low)
|
||||
ASSERT_FALSE(isutf8("\355\240\200\355\260\200", -1)); // paired utf-16 surrogates (range begin)
|
||||
ASSERT_FALSE(isutf8("\355\257\277\355\277\277", -1)); // paired utf-16 surrogates (range end)
|
||||
ASSERT_FALSE(isutf8("\364\220\200\200", -1)); // boundary condition
|
||||
ASSERT_FALSE(isutf8("\220", -1)); // boundary condition
|
||||
}
|
||||
|
||||
TEST(isutf8, oob) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue