11 plan skip_all => "POSIX is unavailable"
12 if $Config{'extensions'} !~ m!\bPOSIX\b!;
17 plan skip_all => "POSIX::Termios not implemented"
18 if !eval "POSIX::Termios->new;1"
19 and $@=~/not implemented/;
23 my @getters = qw(getcflag getiflag getispeed getlflag getoflag getospeed);
25 plan tests => 3 + 2 * (3 + NCCS() + @getters);
30 my $termios = eval { POSIX::Termios->new };
31 is( $@, '', "calling POSIX::Termios->new" );
32 ok( defined $termios, "\tchecking if the object is defined" );
33 isa_ok( $termios, "POSIX::Termios", "\tchecking the type of the object" );
38 -t STDIN or skip("STDIN not a tty", 2);
39 $r = eval { $termios->getattr(0) };
40 is( $@, '', "calling getattr(0)" );
41 ok( defined $r, "\tchecking if the returned value is defined: $r" );
45 -t STDOUT or skip("STDOUT not a tty", 2);
46 $r = eval { $termios->getattr(1) };
47 is( $@, '', "calling getattr(1)" );
48 ok( defined $r, "\tchecking if the returned value is defined: $r" );
52 -t STDERR or skip("STDERR not a tty", 2);
53 $r = eval { $termios->getattr(2) };
54 is( $@, '', "calling getattr(2)" );
55 ok( defined $r, "\tchecking if the returned value is defined: $r" );
59 for my $i (0..NCCS()-1) {
60 $r = eval { $termios->getcc($i) };
61 is( $@, '', "calling getcc($i)" );
62 ok( defined $r, "\tchecking if the returned value is defined: $r" );
66 for my $method (@getters) {
67 $r = eval { $termios->$method() };
68 is( $@, '', "calling $method()" );
69 ok( defined $r, "\tchecking if the returned value is defined: $r" );