diff options
author | Jim Meyering <jim@meyering.net> | 2007-08-02 19:27:07 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-08-02 19:27:07 +0200 |
commit | 674ea8b2dc17a017f2f5a7c67bc8cc90ca18ac53 (patch) | |
tree | 54b18cf3664fa535dbdfd8c11ee31605e1925faa /tests/du/no-x | |
parent | df03463679a32c5f7cde99e6dea0acc8579a0cf6 (diff) | |
download | coreutils-674ea8b2dc17a017f2f5a7c67bc8cc90ca18ac53.tar.xz |
Adjust the other two "no-x" tests and unify all three.
* tests/du/no-x: Factor out du-specific bits.
* tests/chmod/no-x: Use the same code.
* tests/chgrp/no-x: Use the same code.
Diffstat (limited to 'tests/du/no-x')
-rwxr-xr-x | tests/du/no-x | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/du/no-x b/tests/du/no-x index f6b59974a..45cdb0d12 100755 --- a/tests/du/no-x +++ b/tests/du/no-x @@ -46,19 +46,20 @@ fail=0 # This must exit nonzero. du d >/dev/null 2>out && fail=1 -# Depending on whether du/fts is using native fdopendir, we see one +prog=du +# NOTE: this code is the same for all tests/*/no-x tests. +# Depending on whether fts is using native fdopendir, we see one # of the following diagnostics (note also the /y suffix in one case): -# du: `d/no-x': Permission denied -# du: cannot access `d/no-x/y': Permission denied -# du: cannot read directory `d/no-x': Permission denied +# prog: `d/no-x': Permission denied +# prog: cannot access `d/no-x/y': Permission denied +# prog: cannot read directory `d/no-x': Permission denied # Convert either of the latter two to the first one. - -sed 's/^du: cannot access /du: /' out > t && mv t out -sed 's/^du: cannot read directory /du: /' out > t && mv t out +sed "s/^$prog: cannot access /$prog: /" out > t && mv t out +sed "s/^$prog: cannot read directory /$prog: /" out > t && mv t out sed 's,d/no-x/y,d/no-x,' out > t && mv t out -cat <<\EOF > exp -du: `d/no-x': Permission denied +cat <<EOF > exp +$prog: \`d/no-x': Permission denied EOF cmp out exp || fail=1 |