]> git.cameronkatri.com Git - mandoc.git/blob - test-rewb-bsd.c
Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.
[mandoc.git] / test-rewb-bsd.c
1 #include <sys/types.h>
2 #include <regex.h>
3
4 int
5 main(void)
6 {
7 regex_t re;
8
9 if (regcomp(&re, "[[:<:]]word[[:>:]]", REG_EXTENDED | REG_NOSUB))
10 return 1;
11 if (regexec(&re, "the word is here", 0, NULL, 0))
12 return 2;
13 if (regexec(&re, "same word", 0, NULL, 0))
14 return 3;
15 if (regexec(&re, "word again", 0, NULL, 0))
16 return 4;
17 if (regexec(&re, "word", 0, NULL, 0))
18 return 5;
19 if (regexec(&re, "wordy", 0, NULL, 0) != REG_NOMATCH)
20 return 6;
21 if (regexec(&re, "sword", 0, NULL, 0) != REG_NOMATCH)
22 return 7;
23 if (regexec(&re, "reworded", 0, NULL, 0) != REG_NOMATCH)
24 return 8;
25 return 0;
26 }