bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep-dir test


From: Eli Zaretskii
Subject: grep-dir test
Date: Mon, 19 Dec 2011 19:21:50 +0200

The Grep test suite includes the grep-dir test, which does this:

  mkdir a || framework_failure

  echo x | grep -f a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
  echo x | grep -if a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
  echo x | grep -Ff a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
  echo x | grep -Fif a/; { test $? -gt 1 && test $? -lt 128; } || fail=1

If this is intended to test the behavior with a zero-size input file,
then why does it use an empty directory and not an empty file?  Would
using an empty file fail to test some aspect of the Grep behavior?

The problem with "-f a/" is that on some systems (Windows), one cannot
fopen a directory.  So this test fails on those systems for no good
reason, AFAICS.

(Please CC me on the responses, as I'm not subscribed to this list.)

TIA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]