bug-grep
[Top][All Lists]
Advanced

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

[PATCH] tests: avoid spurious quote-mismatch failure on OS/X


From: Jim Meyering
Subject: [PATCH] tests: avoid spurious quote-mismatch failure on OS/X
Date: Sun, 22 Apr 2012 10:40:31 +0200

FYI,

>From 90f12a213194cf5c9f893735bfff436a16ce1fa1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 22 Apr 2012 10:34:08 +0200
Subject: [PATCH] tests: avoid spurious quote-mismatch failure on OS/X

* tests/in-eq-out-infloop: Simplify expected error output, eliminating
expected quotes altogether, thus avoiding spurious OS/X-specific
failure due to mismatch of multi-byte vs. single-byte quotes.
---
 tests/in-eq-out-infloop |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/in-eq-out-infloop b/tests/in-eq-out-infloop
index 0ef408a..1742825 100755
--- a/tests/in-eq-out-infloop
+++ b/tests/in-eq-out-infloop
@@ -15,16 +15,15 @@ done
 echo "$v" > out || framework_failure_

 for arg in out - ''; do
-  case $arg in
-    out) echo "grep: input file 'out' is also the output";;
-    *)   echo "grep: input file '(standard input)' is also the output";;
-  esac > err.exp || framework_failure_
+  # Accommodate both 'out' and '(standard input)', as well as
+  # the multi-byte quoting we see on OS/X-based systems.
+  echo grep: input file ... is also the output > err.exp || framework_failure_

   # Require an exit status of 2.
   # grep-2.8 and earlier would infloop with $arg = out.
   # grep-2.10 and earlier would infloop with $arg = - or $arg = ''.
-  timeout 10 grep 0 $arg < out >> out 2> err; st=$?
-  test $st = 2 || fail=1
+  timeout 10 grep 0 $arg < out >> out 2> err; st=$?; test $st = 2 || fail=1
+  sed 's/file .* is/file ... is/' err > k && mv k err
   compare err.exp err || fail=1

   # But with each of the following options it must not exit-2.
--
1.7.10.228.g81f95



reply via email to

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