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