]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Write ^D as \cD.
authorJim Meyering <jim@meyering.net>
Sun, 7 Sep 2003 17:21:48 +0000 (17:21 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 7 Sep 2003 17:21:48 +0000 (17:21 +0000)
Complete the change of 2003-08-02.

tests/misc/tty-eof

index c0c7b4b8d8a58aa7d8dc4844248a46b7aaa71015..da2e50d1f10ac838999ee2e3d58ba044a0fe0bfe 100755 (executable)
@@ -39,12 +39,13 @@ $@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
       # No input for cut -f2.
       $cmd =~ /^cut/
        or $exp->send("a b\n");
-      $exp->send('\ 4');  # FIXME: it'd be better not to hard-code ^D here
+      $exp->send("\cD");  # This is Control-D.  FIXME: what if that's not EOF?
       $exp->expect (0, '-re', "^a b\\r?\$");
       my $found = $exp->expect (1, '-re', "^.+\$");
       # $found and warn "F: $found: " . $exp->exp_match () . "\n";
       $exp->expect(1, 'eof');
-      defined $found
+      # Expect no output from cut, since we gave it no input.
+      defined $found || $cmd =~ /^cut/
        or (warn "$ME: $cmd didn't produce expected output\n"),
          $fail=1, next;
       defined defined $exp->exitstatus