VirtualBox

source: kBuild/vendor/sed/current/testsuite/bug-regex16.c

最後變更 在這個檔案是 599,由 bird 提交於 18 年 前

GNU sed 4.1.5.

檔案大小: 918 位元組
 
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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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