Source-Changes-HG archive

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

[src/trunk]: src/tests/bin/sh Add another test for the 48875 fix fallout...



details:   https://anonhg.NetBSD.org/src/rev/194e2eb4427e
branches:  trunk
changeset: 345234:194e2eb4427e
user:      kre <kre%NetBSD.org@localhost>
date:      Sat May 14 00:33:02 2016 +0000

description:
Add another test for the 48875 fix fallout...

diffstat:

 tests/bin/sh/t_redir.sh |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r b02b22dd1a5a -r 194e2eb4427e tests/bin/sh/t_redir.sh
--- a/tests/bin/sh/t_redir.sh   Fri May 13 21:48:15 2016 +0000
+++ b/tests/bin/sh/t_redir.sh   Sat May 14 00:33:02 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_redir.sh,v 1.8 2016/05/11 17:43:17 kre Exp $
+# $NetBSD: t_redir.sh,v 1.9 2016/05/14 00:33:02 kre Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -800,6 +800,21 @@
                                f "$B" <&3 >&4
                        done >&2'
 
+       # And this tests a similar condition with that same fix
+       cat  <<- 'DONE' >Script
+               f() {
+                       printf '%s' " hello $1"
+               }
+               exec 3>&1
+               echo $( for i in a b c
+                       do printf '%s' @$i; f $i >&3; done >foo
+               )
+               printf '%s\n' foo=$(cat foo)
+       DONE
+       atf_check -s exit:0 -e empty \
+           -o inline:' hello a hello b hello c\nfoo=@a@b@c\n' \
+           ${TEST_SH} Script
+
        # Tests with sh reading stdin, which is not quite the same internal
        # mechanism.
        echo ". ./f-def || echo >&2 FAIL



Home | Main Index | Thread Index | Old Index