Skip to content

Commit

Permalink
add some test cases for Issue #253
Browse files Browse the repository at this point in the history
  • Loading branch information
kkos committed Apr 28, 2022
1 parent d1cf592 commit 9b9365d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test_utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ extern int main(int argc, char* argv[])
x2("[*[:xdigit:]+]", "-@^+", 3, 4);
n("[[:upper]]", "A");
x2("[[:upper]]", ":", 0, 1);

// Issue #253
e("[[:::]", ":[", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
e("[[:\\]:]", ":]", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
e("[[:\\[:]", ":[", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
e("[[:\\]]", ":]", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
e("[[:upper :]]", "", ONIGERR_INVALID_POSIX_BRACKET_TYPE);
e("[[:upper\\] :]]", "", ONIGERR_INVALID_POSIX_BRACKET_TYPE);

x2("[[:::]]", ":", 0, 1);
x2("[[:\\]:]]*", ":]", 0, 2);
x2("[[:\\[:]]*", ":[", 0, 2);
x2("[[:\\]]]*", ":]", 0, 2);

x2("[\\044-\\047]", "\046", 0, 1);
x2("[\\x5a-\\x5c]", "\x5b", 0, 1);
x2("[\\x6A-\\x6D]", "\x6c", 0, 1);
Expand Down

0 comments on commit 9b9365d

Please sign in to comment.