Change 17822 by rgs@rgs-home on 2002/09/02 19:29:52

        Some simple tests for the POSIX::isXXX() functions.

Affected files ...

.... //depot/perl/ext/POSIX/t/posix.t#14 edit

Differences ...

==== //depot/perl/ext/POSIX/t/posix.t#14 (text) ====
Index: perl/ext/POSIX/t/posix.t
--- perl/ext/POSIX/t/posix.t#13~17311~  Wed Jun 19 14:16:09 2002
+++ perl/ext/POSIX/t/posix.t    Mon Sep  2 12:29:52 2002
@@ -11,7 +11,7 @@
 }
 
 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 @@
 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') {
End of Patch.

Reply via email to