]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(zero-len): Add a test for the above.
authorJim Meyering <jim@meyering.net>
Thu, 25 Mar 2004 17:33:56 +0000 (17:33 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 25 Mar 2004 17:33:56 +0000 (17:33 +0000)
tests/du/files0-from

index 84c9a5753439444405b224598c8322c7904e1f82..d14b33c018dbce25b2dc6f0cb0682ddc33eb8c33 100755 (executable)
@@ -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};