Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 9b9365d

Browse files
committed
add some test cases for Issue #253
1 parent d1cf592 commit 9b9365d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_utf8.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,20 @@ extern int main(int argc, char* argv[])
226226
x2("[*[:xdigit:]+]", "-@^+", 3, 4);
227227
n("[[:upper]]", "A");
228228
x2("[[:upper]]", ":", 0, 1);
229+
230+
// Issue #253
231+
e("[[:::]", ":[", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
232+
e("[[:\\]:]", ":]", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
233+
e("[[:\\[:]", ":[", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
234+
e("[[:\\]]", ":]", ONIGERR_PREMATURE_END_OF_CHAR_CLASS);
235+
e("[[:upper :]]", "", ONIGERR_INVALID_POSIX_BRACKET_TYPE);
236+
e("[[:upper\\] :]]", "", ONIGERR_INVALID_POSIX_BRACKET_TYPE);
237+
238+
x2("[[:::]]", ":", 0, 1);
239+
x2("[[:\\]:]]*", ":]", 0, 2);
240+
x2("[[:\\[:]]*", ":[", 0, 2);
241+
x2("[[:\\]]]*", ":]", 0, 2);
242+
229243
x2("[\\044-\\047]", "\046", 0, 1);
230244
x2("[\\x5a-\\x5c]", "\x5b", 0, 1);
231245
x2("[\\x6A-\\x6D]", "\x6c", 0, 1);

0 commit comments

Comments
 (0)