16 use_ok( 'Pod::Functions' );
18 # How do you test exported vars?
19 my( $pkg_ref, $exp_ref ) = ( \%Pod::Functions::Kinds, \%Kinds );
20 is( $pkg_ref, $exp_ref, '%Pod::Functions::Kinds exported' );
22 ( $pkg_ref, $exp_ref ) = ( \%Pod::Functions::Type, \%Type );
23 is( $pkg_ref, $exp_ref, '%Pod::Functions::Type exported' );
25 ( $pkg_ref, $exp_ref ) = ( \%Pod::Functions::Flavor, \%Flavor );
26 is( $pkg_ref, $exp_ref, '%Pod::Functions::Flavor exported' );
28 ( $pkg_ref, $exp_ref ) = ( \%Pod::Functions::Type_Description,
30 is( $pkg_ref, $exp_ref, '%Pod::Functions::Type_Description exported' );
32 ( $pkg_ref, $exp_ref ) = ( \@Pod::Functions::Type_Order, \@Type_Order );
33 is( $pkg_ref, $exp_ref, '@Pod::Functions::Type_Order exported' );
37 String Regexp Math ARRAY LIST HASH I/O
38 Binary File Flow Namespace Misc Process Modules
39 Objects Socket SysV User Network Time
42 ok( eq_array( \@Type_Order, \@catagories ),
45 my @cat_keys = grep exists $Type_Description{ $_ } => @Type_Order;
47 ok( eq_array( \@cat_keys, \@catagories ),
48 'keys() %Type_Description' );
50 my( undef, $path ) = fileparse( $0 );
51 my $pod_functions = File::Spec->catfile(
52 $path, File::Spec->updir, 'Functions.pm' );
55 my $test_out = do { local $/; <DATA> };
57 skip( "Can't fork '$^X': $!", 1)
58 unless open my $fh, "$^X $pod_functions |";
59 my $fake_out = do { local $/; <$fh> };
60 while ( <$fh> ) { $fake_out .= $_ }
61 skip( "Pipe error: $!", 1)
64 is( $fake_out, $test_out, 'run as plain program' );
69 Functions.t - Test Pod::Functions
73 20011229 Abe Timmerman <abe@ztreet.demon.nl>
79 Functions for SCALARs or strings:
80 chomp, chop, chr, crypt, hex, index, lc, lcfirst, length,
81 oct, ord, pack, q/STRING/, qq/STRING/, reverse, rindex,
82 sprintf, substr, tr///, uc, ucfirst, y///
84 Regular expressions and pattern matching:
85 m//, pos, qr/PATTERN/, quotemeta, s///, split, study
88 abs, atan2, cos, exp, hex, int, log, oct, rand, sin, sqrt,
91 Functions for real @ARRAYs:
92 pop, push, shift, splice, unshift
94 Functions for list data:
95 grep, join, map, qw/STRING/, reverse, sort, unpack
97 Functions for real %HASHes:
98 delete, each, exists, keys, values
100 Input and output functions:
101 binmode, close, closedir, dbmclose, dbmopen, die, eof,
102 fileno, flock, format, getc, print, printf, read, readdir,
103 readline, rewinddir, seek, seekdir, select, syscall,
104 sysread, sysseek, syswrite, tell, telldir, truncate, warn,
107 Functions for fixed length data or records:
108 pack, read, syscall, sysread, sysseek, syswrite, unpack,
111 Functions for filehandles, files, or directories:
112 -X, chdir, chmod, chown, chroot, fcntl, glob, ioctl, link,
113 lstat, mkdir, open, opendir, readlink, rename, rmdir,
114 stat, symlink, umask, unlink, utime
116 Keywords related to control flow of your perl program:
117 caller, continue, die, do, dump, eval, exit, goto, last,
118 next, prototype, redo, return, sub, wantarray
120 Keywords altering or affecting scoping of identifiers:
121 caller, import, local, my, our, package, use
123 Miscellaneous functions:
124 defined, dump, eval, formline, local, my, our, prototype,
125 reset, scalar, undef, wantarray
127 Functions for processes and process groups:
128 alarm, exec, fork, getpgrp, getppid, getpriority, kill,
129 pipe, qx/STRING/, setpgrp, setpriority, sleep, system,
132 Keywords related to perl modules:
133 do, import, no, package, require, use
135 Keywords related to classes and object-orientedness:
136 bless, dbmclose, dbmopen, package, ref, tie, untie, use
138 Low-level socket functions:
139 accept, bind, connect, getpeername, getsockname,
140 getsockopt, listen, recv, send, setsockopt, shutdown,
143 System V interprocess communication functions:
144 msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop,
145 shmctl, shmget, shmread, shmwrite
147 Fetching user and group info:
148 endgrent, endhostent, endnetent, endpwent, getgrent,
149 getgrgid, getgrnam, getlogin, getpwent, getpwnam,
150 getpwuid, setgrent, setpwent
152 Fetching network info:
153 endprotoent, endservent, gethostbyaddr, gethostbyname,
154 gethostent, getnetbyaddr, getnetbyname, getnetent,
155 getprotobyname, getprotobynumber, getprotoent,
156 getservbyname, getservbyport, getservent, sethostent,
157 setnetent, setprotoent, setservent
159 Time-related functions:
160 gmtime, localtime, time, times