11 plan skip_all => "POSIX is unavailable" if $Config{'extensions'} !~ m!\bPOSIX\b!;
17 my @getters = qw(getcflag getiflag getispeed getlflag getoflag getospeed);
19 plan tests => 3 + 2 * (3 + NCCS() + @getters);
24 my $termios = eval { POSIX::Termios->new };
25 is( $@, '', "calling POSIX::Termios->new" );
26 ok( defined $termios, "\tchecking if the object is defined" );
27 isa_ok( $termios, "POSIX::Termios", "\tchecking the type of the object" );
32 -t STDIN or skip("STDIN not a tty", 2);
33 $r = eval { $termios->getattr(0) };
34 is( $@, '', "calling getattr(0)" );
35 ok( defined $r, "\tchecking if the returned value is defined: $r" );
39 -t STDOUT or skip("STDOUT not a tty", 2);
40 $r = eval { $termios->getattr(1) };
41 is( $@, '', "calling getattr(1)" );
42 ok( defined $r, "\tchecking if the returned value is defined: $r" );
46 -t STDERR or skip("STDERR not a tty", 2);
47 $r = eval { $termios->getattr(2) };
48 is( $@, '', "calling getattr(2)" );
49 ok( defined $r, "\tchecking if the returned value is defined: $r" );
53 for my $i (0..NCCS()-1) {
54 $r = eval { $termios->getcc($i) };
55 is( $@, '', "calling getcc($i)" );
56 ok( defined $r, "\tchecking if the returned value is defined: $r" );
60 for my $method (@getters) {
61 $r = eval { $termios->$method() };
62 is( $@, '', "calling $method()" );
63 ok( defined $r, "\tchecking if the returned value is defined: $r" );