X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tests%2Fzgrep-f;h=40da9ffab7e9112d5d5f2adb687252d8ff7f5855;hb=d49274f4ed038cfb361d634dc78143759ffc7a0d;hp=ba76bfd9714dd7e4f7a5136247fd0e508e320291;hpb=0555c158a0cf37446f4e73dc4d0ee556766d0a9b;p=debian%2Fgzip diff --git a/tests/zgrep-f b/tests/zgrep-f old mode 100644 new mode 100755 index ba76bfd..40da9ff --- a/tests/zgrep-f +++ b/tests/zgrep-f @@ -2,7 +2,7 @@ # Ensure that zgrep -f - works like grep -f - # Before gzip-1.4, it would fail. -# Copyright (C) 2009-2010 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,15 +15,13 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # limit so don't run it by default. . "${srcdir=.}/init.sh"; path_prepend_ .. -require_POSIX_grep_ - -echo needle > n || framework_failure_ -echo needle > haystack || framework_failure_ +printf 'needle\nn2\n' > n || framework_failure_ +cp n haystack || framework_failure_ gzip haystack || framework_failure_ fail=0 @@ -31,4 +29,15 @@ zgrep -f - haystack.gz < n > out 2>&1 || fail=1 compare out n || fail=1 +if ${BASH_VERSION+:} false; then + set +o posix + # This failed with gzip 1.6. + cat n n >nn || framework_failure_ + eval 'zgrep -h -f <(cat n) haystack.gz haystack.gz' >out || fail=1 + compare out nn || fail=1 +fi + +# This failed with gzip 1.4. +echo a-b | zgrep -e - > /dev/null || fail=1 + Exit $fail