coreutils
[Top][All Lists]
Advanced

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

[PATCH] tests: fix recent portability issues on solaris 10


From: Pádraig Brady
Subject: [PATCH] tests: fix recent portability issues on solaris 10
Date: Thu, 21 Dec 2017 13:54:12 +0000

* tests/misc/ptx.pl: Escape the '^' character which is
otherwise considered as a line continuation character.
* tests/misc/shred-remove.sh: sed doesn't support \n.
---
 tests/misc/ptx.pl          | 6 +++---
 tests/misc/shred-remove.sh | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/misc/ptx.pl b/tests/misc/ptx.pl
index 219e904..e1810d5 100755
--- a/tests/misc/ptx.pl
+++ b/tests/misc/ptx.pl
@@ -43,9 +43,9 @@ my @Tests =
 
 # with coreutils-8.28 and earlier, the -S option would infloop with
 # matches of zero-length.
-["S-infloop", '-S ^', {IN=>"a\n"}, {EXIT=>1},
-                      {ERR_SUBST=>'s/^.*reg.*ex.*length zero.*$/regexlzero/'},
-                      {ERR=>"regexlzero\n"}],
+["S-infloop", '-S \^', {IN=>"a\n"}, {EXIT=>1},
+                       {ERR_SUBST=>'s/^.*reg.*ex.*length zero.*$/regexlzero/'},
+                       {ERR=>"regexlzero\n"}],
 );
 
 @Tests = triple_test \@Tests;
diff --git a/tests/misc/shred-remove.sh b/tests/misc/shred-remove.sh
index 8720eaf..f35e8a5 100755
--- a/tests/misc/shred-remove.sh
+++ b/tests/misc/shred-remove.sh
@@ -47,8 +47,10 @@ returns_ 1 shred -n0 --remove=none $file 2>/dev/null || 
fail=1
 # Ensure rename passes complete.
 # coreutils-8.28 did not do the decreasing length rename
 # which may have leaked the length of the removed file name
-printf 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_. |
-sed 's/./&\n/g' | xargs touch || framework_failure_  # test level exhaustion
+NL="
+"
+printf 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ |
+sed "s/./&\\$NL/g" | xargs touch || framework_failure_  # test level exhaustion
 touch test 000 || framework_failure_  # test level increment
 shred -vu test 2>out || fail=1
 cat <<\EOF >exp || framework_failure_
-- 
2.9.3




reply via email to

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