This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4e453fc
)
Add tests for passing POSIX::Termios->getcc() out of range subscripts.
author
Nicholas Clark
<nick@ccl4.org>
Tue, 6 Sep 2011 12:23:53 +0000
(14:23 +0200)
committer
Nicholas Clark
<nick@ccl4.org>
Tue, 13 Sep 2011 09:28:05 +0000
(11:28 +0200)
ext/POSIX/t/termios.t
patch
|
blob
|
blame
|
history
diff --git
a/ext/POSIX/t/termios.t
b/ext/POSIX/t/termios.t
index
e68fb5a
..
636efe1
100644
(file)
--- a/
ext/POSIX/t/termios.t
+++ b/
ext/POSIX/t/termios.t
@@
-54,6
+54,11
@@
if (defined $termios) {
is($@, '', "calling getcc($i)");
like($r, qr/\A-?[0-9]+\z/, 'returns an integer');
}
is($@, '', "calling getcc($i)");
like($r, qr/\A-?[0-9]+\z/, 'returns an integer');
}
+ for my $i (NCCS, ~0) {
+ my $r = eval { $termios->getcc($i) };
+ like($@, qr/\ABad getcc subscript/, "calling getcc($i)");
+ is($r, undef, 'returns undef')
+ }
for my $method (qw(getcflag getiflag getispeed getlflag getoflag getospeed)) {
my $r = eval { $termios->$method() };
for my $method (qw(getcflag getiflag getispeed getlflag getoflag getospeed)) {
my $r = eval { $termios->$method() };