]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
make sure tsort fails given an odd number of input tokens
authorJim Meyering <jim@meyering.net>
Wed, 23 Apr 2003 22:24:24 +0000 (22:24 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 23 Apr 2003 22:24:24 +0000 (22:24 +0000)
tests/tsort/basic-1

index a70830c5892b352a370bf8544ccb2c4efcbead2e..68340f07e58433deaf28e8f0d4cb28520ba187dc 100755 (executable)
@@ -41,6 +41,13 @@ my @Tests =
     {OUT => "a\nb\nc\nx\nd\ny\ne\nz\nf\ng\n"}],
    ['tree-2', {IN => "a b b c c d d e e f f g\nc x x y y z\nf r r s s t\n"},
     {OUT => "a\nb\nc\nx\nd\ny\ne\nz\nf\nr\ng\ns\nt\n"}],
+
+   # Before coreutils-5.0.1, given an odd number of input tokens,
+   # tsort would accept that and treat the input as if an additional
+   # copy of the final token were appended.
+   ['odd', {IN => "a\n"},
+    {EXIT => 1},
+    {ERR => "tsort: odd.1: input contains an odd number of tokens\n"}],
   );
 
 my $save_temps = $ENV{DEBUG};