summaryrefslogtreecommitdiff
path: root/tests/du/files0-from
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-03-25 17:33:56 +0000
committerJim Meyering <jim@meyering.net>2004-03-25 17:33:56 +0000
commit98529c8bfce16811a4edadcc8b956d79ca10ffd9 (patch)
treebdfe56876947dc3405f4410bd144a682b3c34040 /tests/du/files0-from
parentf11cd8f5c4a8f848155741ceff4ad04680942fce (diff)
downloadcoreutils-98529c8bfce16811a4edadcc8b956d79ca10ffd9.tar.xz
(zero-len): Add a test for the above.
Diffstat (limited to 'tests/du/files0-from')
-rwxr-xr-xtests/du/files0-from8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/du/files0-from b/tests/du/files0-from
index 84c9a5753..d14b33c01 100755
--- a/tests/du/files0-from
+++ b/tests/du/files0-from
@@ -66,6 +66,14 @@ my @Tests =
# two file names, with final NUL
['2a', '--files0-from=-', '<',
{IN=>{f=>"g\0g\0"}}, {AUX=>{g=>"x".64*1024}}, {OUT=>"4\tg\n4\tg\n"} ],
+
+ # Ensure that du processes FILEs following a zero-length name.
+ ['zero-len', '--files0-from=-', '<',
+ {IN=>{f=>"\0g\0"}}, {AUX=>{g=>"x".64*1024}},
+ {OUT=>"4\tg\n"},
+ {ERR => "du: -:1: invalid zero-length file name\n"},
+ {EXIT=>1}
+ ],
);
my $save_temps = $ENV{DEBUG};