summaryrefslogtreecommitdiff
path: root/tests/pcre-abort
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-21 12:26:47 +0200
committerJim Meyering <meyering@redhat.com>2011-05-21 12:26:47 +0200
commit2c1a222ec4a90219486f01efcd7d1cfd2ce6d30f (patch)
treec5a6f0b83f540c916af88850dd2b793b2eeaa887 /tests/pcre-abort
parentcda56673b41c68b525c46d0d1737cc53a125b274 (diff)
downloadgrep-2c1a222ec4a90219486f01efcd7d1cfd2ce6d30f.tar.gz
tests: show how to make grep -P abort
* tests/pcre-abort: New file. Minimal testcase by Paolo Bonzini, derived from a report by www.beaver@list.ru. * tests/Makefile.am (TESTS): Add it. (XFAIL_TESTS): Add it here, too, since this test always fails, for now.
Diffstat (limited to 'tests/pcre-abort')
-rwxr-xr-xtests/pcre-abort19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pcre-abort b/tests/pcre-abort
new file mode 100755
index 00000000..fd679325
--- /dev/null
+++ b/tests/pcre-abort
@@ -0,0 +1,19 @@
+#! /bin/sh
+# Show how to make grep -P abort.
+#
+# Copyright (C) 2011 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 aaaaaaaaaaaaaab > in || framework_failure_
+grep -P '((a+)*)+$' in > out || fail=1
+compare in out || fail=1
+
+Exit $fail