Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/grep PR/51875: Ngie Cooper: portability fixes



details:   https://anonhg.NetBSD.org/src/rev/834737af2b4a
branches:  trunk
changeset: 820761:834737af2b4a
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 14 20:43:52 2017 +0000

description:
PR/51875: Ngie Cooper: portability fixes

diffstat:

 tests/usr.bin/grep/d_binary.out |  2 +-
 tests/usr.bin/grep/t_grep.sh    |  8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 753beec00bd2 -r 834737af2b4a tests/usr.bin/grep/d_binary.out
--- a/tests/usr.bin/grep/d_binary.out   Sat Jan 14 20:05:37 2017 +0000
+++ b/tests/usr.bin/grep/d_binary.out   Sat Jan 14 20:43:52 2017 +0000
@@ -1,1 +1,1 @@
-Binary file /bin/sh matches
+Binary file test.file matches
diff -r 753beec00bd2 -r 834737af2b4a tests/usr.bin/grep/t_grep.sh
--- a/tests/usr.bin/grep/t_grep.sh      Sat Jan 14 20:05:37 2017 +0000
+++ b/tests/usr.bin/grep/t_grep.sh      Sat Jan 14 20:43:52 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $
+# $NetBSD: t_grep.sh,v 1.3 2017/01/14 20:43:52 christos Exp $
 #
 # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,7 +43,9 @@
 }
 binary_body()
 {
-       atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+       dd if=/dev/zero count=1 of=test.file
+       echo -n "foobar" >> test.file
+       atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
 }
 
 atf_test_case recurse
@@ -57,7 +59,7 @@
        echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
        echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
 
-       atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
+       atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
 }
 
 atf_test_case recurse_symlink



Home | Main Index | Thread Index | Old Index