summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/ext/POSIX
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/ext/POSIX')
-rw-r--r--gnu/usr.bin/perl/ext/POSIX/t/is.t4
-rw-r--r--gnu/usr.bin/perl/ext/POSIX/t/posix.t9
2 files changed, 12 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/ext/POSIX/t/is.t b/gnu/usr.bin/perl/ext/POSIX/t/is.t
index 9ab851cd4e2..489b3a96384 100644
--- a/gnu/usr.bin/perl/ext/POSIX/t/is.t
+++ b/gnu/usr.bin/perl/ext/POSIX/t/is.t
@@ -52,6 +52,10 @@ my %classes =
" \t" => [ qw(space) ],
"abcde\001" => [],
+
+ # An empty string. Always true (al least in old days) [bug #24554]
+ '' => [ qw(print graph alnum alpha lower upper digit xdigit
+ punct cntrl space) ],
);
diff --git a/gnu/usr.bin/perl/ext/POSIX/t/posix.t b/gnu/usr.bin/perl/ext/POSIX/t/posix.t
index f8339f7a4c1..58b3a4843de 100644
--- a/gnu/usr.bin/perl/ext/POSIX/t/posix.t
+++ b/gnu/usr.bin/perl/ext/POSIX/t/posix.t
@@ -11,7 +11,7 @@ BEGIN {
}
require "./test.pl";
-plan(tests => 61);
+plan(tests => 65);
use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write
errno);
@@ -259,6 +259,13 @@ ok( POSIX::isspace("\t"), 'isspace' );
ok(!POSIX::isspace('_'), 'isspace' );
ok( POSIX::isxdigit('f'), 'isxdigit' );
ok(!POSIX::isxdigit('g'), 'isxdigit' );
+# metaphysical question : what should be returned for an empty string ?
+# anyway this shouldn't segfault (bug #24554)
+ok( POSIX::isalnum(''), 'isalnum empty string' );
+ok( POSIX::isalnum(undef),'isalnum undef' );
+# those functions should stringify their arguments
+ok(!POSIX::isalpha([]), 'isalpha []' );
+ok( POSIX::isprint([]), 'isprint []' );
# Check that output is not flushed by _exit. This test should be last
# in the file, and is not counted in the total number of tests.