diff options
author | conklin <conklin@FreeBSD.org> | 1993-07-30 20:16:53 +0000 |
---|---|---|
committer | conklin <conklin@FreeBSD.org> | 1993-07-30 20:16:53 +0000 |
commit | 5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7 (patch) | |
tree | e01cf2a5cc6062467dbb628a7beef06eaa39845d /gnu/lib/libregex/test/bsd-interf.c | |
parent | 605993f7be3eb2154f219e29b739c6d76f373405 (diff) | |
download | FreeBSD-src-5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7.zip FreeBSD-src-5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7.tar.gz |
GNU Regex 0.12
Diffstat (limited to 'gnu/lib/libregex/test/bsd-interf.c')
-rw-r--r-- | gnu/lib/libregex/test/bsd-interf.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/lib/libregex/test/bsd-interf.c b/gnu/lib/libregex/test/bsd-interf.c new file mode 100644 index 0000000..56f9e2a --- /dev/null +++ b/gnu/lib/libregex/test/bsd-interf.c @@ -0,0 +1,38 @@ +/* bsd-interf.c: test BSD interface. */ + +#ifndef _POSIX_SOURCE /* whole file */ + +#include "test.h" + +void +test_berk_search (pattern, string) + const char *pattern; + char *string; +{ + const char *return_value = re_comp (pattern); + + if (return_value != 0) + { + printf ("This didn't compile: `%s'.\n", pattern); + printf (" The error message was: `%s'.\n", return_value); + } + else + if (test_should_match && re_exec (string) != strlen (string)) + { + printf ("Should have matched but didn't:\n"); + printf (" The pattern was: %s.\n", pattern); + if (string) + printf (" The string was: `%s'.'n", string); + else + printf (" The string was empty.\n"); + } +} + + +void +test_bsd_interface () +{ + test_berk_search ("a", "ab"); +} + +#endif /* _POSIX_SOURCE */ |