>From f79cd1bbd135f7c1751059be9d1d785598a7759b Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka Date: Fri, 24 Oct 2014 13:33:04 -0700 Subject: [PATCH 2/2] tests: add test for grep -P fix * tests/pcre-o: New test for this change. * tests/Makefile.am (TESTS): Add it. --- tests/Makefile.am | 1 + tests/pcre-o | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 tests/pcre-o diff --git a/tests/Makefile.am b/tests/Makefile.am index c298835..f6f051c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -90,6 +90,7 @@ TESTS = \ pcre-abort \ pcre-infloop \ pcre-invalid-utf8-input \ + pcre-o \ pcre-utf8 \ pcre-w \ pcre-wx-backref \ diff --git a/tests/pcre-o b/tests/pcre-o new file mode 100755 index 0000000..3d0677c --- /dev/null +++ b/tests/pcre-o @@ -0,0 +1,17 @@ +#! /bin/sh +# Ensure that grep -oP doesn't cause internal error at match. +# +# Copyright (C) 2014 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src +require_pcre_ + +fail=0 + +echo ab | grep -oP 'a' || fail=1 + +Exit $fail -- 1.9.3