diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-01-15 23:08:59 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-01-15 23:08:59 +0000 |
commit | ca0834218adf25b9cf44601400c1c4a8600d9f5f (patch) | |
tree | d03ac3be5c40f1897b2b6802fb3b1a2b0c4e7cfe /test-rewb-sysv.c | |
parent | 0ae9da150d599305f27b737214acfa3dc181d0e8 (diff) |
Diffstat (limited to 'test-rewb-sysv.c')
-rw-r--r-- | test-rewb-sysv.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test-rewb-sysv.c b/test-rewb-sysv.c new file mode 100644 index 0000000000000..cb35c544e971a --- /dev/null +++ b/test-rewb-sysv.c @@ -0,0 +1,26 @@ +#include <sys/types.h> +#include <regex.h> + +int +main(void) +{ + regex_t re; + + if (regcomp(&re, "\\<word\\>", REG_EXTENDED | REG_NOSUB)) + return 1; + if (regexec(&re, "the word is here", 0, NULL, 0)) + return 2; + if (regexec(&re, "same word", 0, NULL, 0)) + return 3; + if (regexec(&re, "word again", 0, NULL, 0)) + return 4; + if (regexec(&re, "word", 0, NULL, 0)) + return 5; + if (regexec(&re, "wordy", 0, NULL, 0) != REG_NOMATCH) + return 6; + if (regexec(&re, "sword", 0, NULL, 0) != REG_NOMATCH) + return 7; + if (regexec(&re, "reworded", 0, NULL, 0) != REG_NOMATCH) + return 8; + return 0; +} |