Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created October 23, 2017 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/e377f82d12d0d2fa0b02de0bdf5e697b to your computer and use it in GitHub Desktop.
Save zoffixznet/e377f82d12d0d2fa0b02de0bdf5e697b to your computer and use it in GitHub Desktop.
use Test;
plan 1;
subtest '.t returns True for TTY' => {
plan 1;
my $tt = shell :out, :err, 'tty';
if $tt and (my $path = $tt.out.slurp(:close).trim)
and $path ne 'not a tty' {
my $fh will leave {.close} = $path.IO.open;
is-deeply $fh.eof, False, 'unread-from TTY handle .eof is False';
}
else {
skip 'could not figure out how to get a TTY handle';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment