VirtualBox

source: kBuild/vendor/sed/4.1.5/testsuite/bug-regex16.c@ 599

Last change on this file since 599 was 599, checked in by bird, 18 years ago

GNU sed 4.1.5.

File size: 918 bytes
Line 
1/* Test re_compile_pattern error messages. */
2
3#include <stdio.h>
4#include <string.h>
5#include <regex.h>
6
7int
8main (void)
9{
10 struct re_pattern_buffer re;
11 const char *s;
12 int ret = 0;
13
14 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
15 memset (&re, 0, sizeof (re));
16 s = re_compile_pattern ("[[.invalid_collating_symbol.]]", 30, &re);
17 if (s == NULL || strcmp (s, "Invalid collation character"))
18 {
19 printf ("re_compile_pattern returned %s\n", s);
20 ret = 1;
21 }
22 s = re_compile_pattern ("[[=invalid_equivalence_class=]]", 31, &re);
23 if (s == NULL || strcmp (s, "Invalid collation character"))
24 {
25 printf ("re_compile_pattern returned %s\n", s);
26 ret = 1;
27 }
28 s = re_compile_pattern ("[[:invalid_character_class:]]", 29, &re);
29 if (s == NULL || strcmp (s, "Invalid character class name"))
30 {
31 printf ("re_compile_pattern returned %s\n", s);
32 ret = 1;
33 }
34 return ret;
35}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette