summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-09-02 19:29:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-09-02 19:29:52 +0000
commit4b3c65319d38214d41329be28b326e1cec9de88b (patch)
tree7e13fd686bf89754db7335b9f838b5ffdeb4be74 /ext/POSIX
parente3256f86073a9cc1ed3f69791fe72ca60b6e2dbc (diff)
downloadperl-4b3c65319d38214d41329be28b326e1cec9de88b.tar.gz
Some simple tests for the POSIX::isXXX() functions.
p4raw-id: //depot/perl@17822
Diffstat (limited to 'ext/POSIX')
-rw-r--r--ext/POSIX/t/posix.t26
1 files changed, 25 insertions, 1 deletions
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t
index 8f31ada848..01dba7f748 100644
--- a/ext/POSIX/t/posix.t
+++ b/ext/POSIX/t/posix.t
@@ -11,7 +11,7 @@ BEGIN {
}
require "./test.pl";
-plan(tests => 39);
+plan(tests => 61);
use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write
@@ -223,6 +223,30 @@ is ($result, undef, "fgets should fail");
like ($@, qr/^Use method IO::Handle::gets\(\) instead/,
"check its redef message");
+# Simplistic tests for the isXXX() functions (bug #16799)
+ok( POSIX::isalnum('1'), 'isalnum' );
+ok(!POSIX::isalnum('*'), 'isalnum' );
+ok( POSIX::isalpha('f'), 'isalpha' );
+ok(!POSIX::isalpha('7'), 'isalpha' );
+ok( POSIX::iscntrl("\cA"),'iscntrl' );
+ok(!POSIX::iscntrl("A"), 'iscntrl' );
+ok( POSIX::isdigit('1'), 'isdigit' );
+ok(!POSIX::isdigit('z'), 'isdigit' );
+ok( POSIX::isgraph('@'), 'isgraph' );
+ok(!POSIX::isgraph(' '), 'isgraph' );
+ok( POSIX::islower('l'), 'islower' );
+ok(!POSIX::islower('L'), 'islower' );
+ok( POSIX::isupper('U'), 'isupper' );
+ok(!POSIX::isupper('u'), 'isupper' );
+ok( POSIX::isprint('$'), 'isprint' );
+ok(!POSIX::isprint("\n"), 'isprint' );
+ok( POSIX::ispunct('%'), 'ispunct' );
+ok(!POSIX::ispunct('u'), 'ispunct' );
+ok( POSIX::isspace("\t"), 'isspace' );
+ok(!POSIX::isspace('_'), 'isspace' );
+ok( POSIX::isxdigit('f'), 'isxdigit' );
+ok(!POSIX::isxdigit('g'), 'isxdigit' );
+
# 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.
if ($^O eq 'vos') {