summaryrefslogtreecommitdiff
path: root/tests/test-regex.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix some "make sc_prohibit_leading_TABs" findings.Bruno Haible2023-04-111-18/+18
| | | | | * tests/test-calloc-gnu.c: Expand tabs. * tests/test-regex.c: Likewise.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* regex: modernize to newer regex bugsetPaul Eggert2021-07-141-5/+6
| | | | | | | | | | | Problem reported by Hiroo Hayashi in: https://lists.gnu.org/r/bug-gnulib/2021-07/msg00024.html * m4/regex.m4 (gl_REGEX): Allow newer glibc behavior for ()0|\1, behavior where the regex compiles but does not match. Test for glibc bug 11053. * tests/test-regex.c (bug_regex11, main): Add casts needed for printf portability. (main): Allow newer glibc behavior for ()0|\1.
* regex-tests: test for regressions fixed by the previous commitDmitry V. Levin2021-06-061-0/+4
| | | | | | | * tests/test-regex.c (tests): Add test cases for *+ and ** regressions fixed by the previous commit. Link: https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00134.html
* regex-tests: remove incorrect commentDmitry V. Levin2021-06-061-1/+0
| | | | | | | | * tests/test-regex.c (tests): Remove the comment saying that some tests are not used. That comment was copied along with tests from glibc where some of these tests are commented out. Fixes: 70b673eb7 ("regex: fix longstanding backref match bug")
* regex-tests: add bug 11053 testPaul Eggert2021-02-051-0/+29
| | | | * tests/test-regex.c (main): New test case for glibc bug 11053.
* regex: fix longstanding backref match bugPaul Eggert2021-02-051-2/+111
| | | | | | | | | | | | | | This fixes a longstanding glibc bug concerning backreferences <https://sourceware.org/11053> (2009-12-04). * lib/regexec.c (proceed_next_node, push_fail_stack) (pop_fail_stack): Push and pop the previous registers as well as the current ones. All callers changed. (set_regs): Also pop if CUR_NODE has already been checked, so that it does not get added as a duplicate set entry. (update_regs): Fix comment location. * tests/test-regex.c (tests): New constant. (bug_regex11): New test function. (main): Bump alarm value. Call new test function.
* regex-tests: fix typoPaul Eggert2021-02-051-1/+2
| | | | | * tests/test-regex.c (main): Fix typo that would have caused an old test case to report incorrect values on failure.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* regex-tests: tweak to avoid a clang-10 warningJim Meyering2020-12-291-1/+1
| | | | | | | | | * tests/test-regex.c: Compare with explicit zero, rather than as boolean to avoid this from clang-10: test-regex.c:315:9: error: converting the result of '<<' to a \ boolean always evaluates to true \ [-Werror,-Wtautological-constant-compare] if (! REG_STARTEND)
* regex-tests: Make test more robust.Bruno Haible2020-09-261-26/+34
| | | | | * tests/test-regex.c (main): Make sure to revert the locale to "C" after the test in "tr_TR.UTF-8" locale. Exit if we can't revert it.
* regex-tests: fix possible Turkish false-alarmPaul Eggert2020-09-251-1/+3
| | | | | | | * modules/regex-tests (Depends-on): Add wctype-h. * tests/test-regex.c: Include wctype.h. (main): Check that ‘i’ uppercases to ‘İ’ in Turkish, as the Turkish regex test assumes this.
* regex-tests: fix test and add debug outputPaul Eggert2020-09-251-46/+86
| | | | | | | | | | | | | Perhaps this will fix the recent grep test failure reported at: https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/199 At least, the debug output should help narrow down the failure. * tests/test-regex.c: Include stdarg.h, stdio.h. (exit_status): New var. (report_error): New function. (main): Use it to report failures to stdout instead of merely exiting with some nonzero status. The status info alone isn’t enough to do remote debugging. In the new tr_TR.UTF-8 test, clear regex before calling re_compile_pattern, fixing a portability bug.
* regex: fix ignore-case Turkish bugPaul Eggert2020-09-231-5/+36
| | | | | | | | * lib/regex_internal.c (build_wcs_upper_buffer): Do not assume that converting single-byte character to upper yields a single-byte character. This is not true for Turkish, where towupper (L'i') yields L'İ', which is not single-byte. * tests/test-regex.c (main): Test for this bug.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* regex: work around a bug in glibc-2.27 and priorJim Meyering2018-12-151-0/+11
| | | | | | * m4/regex.m4 (gl_REGEX): Reject any system regexp that gets a failed assertion for /0|()0|\1|0/. * tests/test-regex.c (main): Add the same test here.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* maint: shorten https://lists.gnu.org/archive/html/... linksJim Meyering2017-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each /archive/html/ part can be replace with /r/. Run this to induce the change: git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g' * ChangeLog: Perform that substitution. * Makefile: Likewise. * STATUS-libposix: Likewise. * build-aux/bootstrap: Likewise. * doc/maintain.texi: Likewise. * gnulib-tool: Likewise. * lib/allocator.h: Likewise. * lib/argp-ba.c: Likewise. * lib/argp-pv.c: Likewise. * lib/canon-host.c: Likewise. * lib/canonicalize-lgpl.c: Likewise. * lib/float.in.h: Likewise. * lib/fstat.c: Likewise. * lib/getdelim.c: Likewise. * lib/getprogname.c: Likewise. * lib/glthread/thread.h: Likewise. * lib/intprops.h: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/safe-read.c: Likewise. * lib/signal.in.h: Likewise. * lib/stat.c: Likewise. * lib/stdbool.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdio.in.h: Likewise. * lib/sysexits.in.h: Likewise. * lib/timespec.h: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/alloca.m4: Likewise. * m4/extern-inline.m4: Likewise. * m4/fstatat.m4: Likewise. * m4/gnulib-common.m4: Likewise. * m4/lib-ignore.m4: Likewise. * m4/printf.m4: Likewise. * m4/regex.m4: Likewise. * m4/stat-size.m4: Likewise. * m4/std-gnu11.m4: Likewise. * m4/stdbool.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/threadlib.m4: Likewise. * m4/vararrays.m4: Likewise. * pygnulib/GLImport.py: Likewise. * tests/test-exp.h: Likewise. * tests/test-exp2.h: Likewise. * tests/test-expm1.h: Likewise. * tests/test-fflush2.c: Likewise. * tests/test-getopt_long.h: Likewise. * tests/test-intprops.c: Likewise. * tests/test-log.h: Likewise. * tests/test-log10.h: Likewise. * tests/test-log1p.h: Likewise. * tests/test-log2.h: Likewise. * tests/test-printf-posix.h: Likewise. * tests/test-regex.c: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-stdalign.c: Likewise. * tests/test-stdbool.c: Likewise. * tests/test-vasnprintf-posix.c: Likewise. * tests/test-vasprintf-posix.c: Likewise. * top/maint.mk: Likewise.
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-3/+3
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* misc: port better to gcc -fsanitize=addressPaul Eggert2016-02-061-14/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without these patches, ./configure CFLAGS='-fsanitize=address' would compute incorrect values. This patch fixes some (but not all) test failures with recent glibc, with this configuration. * m4/acl.m4 (gl_ACL_GET_FILE): * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): * m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): * m4/getdelim.m4 (gl_FUNC_GETDELIM): * m4/getgroups.m4 (gl_FUNC_GETGROUPS): * m4/getline.m4 (gl_FUNC_GETLINE): * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): * m4/regex.m4 (gl_REGEX): * m4/strndup.m4 (gl_FUNC_STRNDUP): * tests/test-calloc-gnu.c (main): * tests/test-duplocale.c (main): * tests/test-getgroups.c (main): * tests/test-getline.c (main): * tests/test-inttostr.c (main): * tests/test-localename.c (test_locale_name) (test_locale_name_thread, test_locale_name_environ) (test_locale_name_default): * tests/test-regex.c (main): * tests/test-setlocale1.c (main): * tests/test-stat.h (test_stat_func): Free heap-allocated storage before exiting. * m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX): Don't match *_foo symbols inserted by AddressSanitizer. * tests/test-regex.c, tests/test-stat.c: Include stdlib.h, for 'free'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* regex-tests, regex: allow glibc re_search behaviorDmitry V. Levin2013-04-111-6/+17
| | | | | | | | | | | | | | | | | | | | The data passed to re_search by the test for glibc bug 15078 is a multi-character collating element followed by a single character. According to POSIX, "It is unspecified whether a non-matching list expression matches a multi-character collating element that is not matched by any of the expressions." One of differences between glibc and gnulib implementations of re_search is that glibc re_search matches multi-character collating elements in that case while gnulib re_search doesn't. Since both re_search implementations conform to standard, change the test to allow glibc re_search behavior. * tests/test-regex.c (main): In test for glibc bug 15078, reformat re_search input data to make the multi-character collating element in it clearly visible, and treat re_search return code 0 as valid. * m4/regex.m4 (gl_REGEX): Likewise.
* regex-tests: skip UTF-8 test on mingwEric Blake2013-03-121-19/+26
| | | | | | | | | | | | | test-regex failed on mingw; and I traced it in gdb to an instance of init_dfa() setting dfa->is_utf8 to 0 in spite of setlocale() claiming success for "en_US.UTF-8". test-wcwidth already has precedent for skipping utf-8 tests where the system (or gnulib setlocale replacement, in this case) lies about utf-8 support. * modules/regex-tests (Depends-on): Add localcharset. * tests/test-regex.c (main): Use it to skip test on mingw. Signed-off-by: Eric Blake <eblake@redhat.com>
* regex: port to mingw's recent addition of undeclared alarmEric Blake2013-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On mingw (at least, when cross-compiling with Fedora 18's mingw32-headers-2.0.999-0.15.trunk.20121110.fc18.noarch build), compilation of test-regex fails: test-regex.c: In function 'main': test-regex.c:42:11: error: 'SIGALRM' undeclared (first use in this function) test-regex.c:42:11: note: each undeclared identifier is reported only once for each function it appears in test-regex.c:43:3: warning: implicit declaration of function 'alarm' It turns out that recent mingw64 added an export of alarm() and SIGALRM, but guarded their declarations behind __USE_MINGW_ALARM (default off, and with alarm() only in the non-standard <io.h>); so the m4 tests were setting HAVE_ALARM to 1 based on link success but then failing to compile. * doc/posix-functions/alarm.texi (alarm): Document that alarm exists but still doesn't work in newer mingw. * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm declaration, not existence. Ensure SIGALRM is not trapped. * m4/mktime.m4 (gl_FUNC_MKTIME): Likewise. * m4/regex.m4 (gl_REGEX): Likewise. * m4/remainderf.m4 (gl_FUNC_REMAINDERF_WORKS): Likewise. * tests/test-regex.c (main): Use correct probe for alarm. Signed-off-by: Eric Blake <eblake@redhat.com>
* regex-tests, regex: fix bug: memset undeclaredPaul Eggert2013-02-031-1/+1
| | | | | | | | | | * tests/test-regex.c: Don't include regex.h twice. Include string.h, to declare memset. Christensen's report also mentioned this issue. * m4/regex.m4 (gl_REGEX): Keep test program more in sync with test-regex.c, to avoid future problems like this. Remove AC_INCLUDES_DEFAULT. Include <string.h>. Don't include <regex.h> twice.
* regex-tests: new modulePaul Eggert2013-01-311-0/+185
* modules/regex-tests, tests/test-regex.c: New files.