Debian lenny version packages
[pkg-perl] / deb-src / libtest-warn-perl / libtest-warn-perl-0.11 / README
1 Test/Warn version 0.10
2 ======================
3
4 INSTALLATION
5
6 To install this module type the following:
7
8    perl Makefile.PL
9    make
10    make test
11    make install
12
13 DEPENDENCIES
14
15 This module requires these other modules and libraries:
16
17 Test::Builder
18 Test::Exception
19 Array::Compare
20 Sub::Uplevel
21 List::Util
22 Tree::DAG_Node
23 File::Spec
24
25 SYNOPSIS
26       use Test::Warn;
27
28       warning_is    {foo(-dri => "/")} "Unknown Parameter 'dri'", "dri != dir gives warning";
29       warnings_are  {bar(1,1)} ["Width very small", "Height very small"];
30   
31       warning_is    {add(2,2)} undef, "No warning to calc 2+2"; # or
32       warnings_are  {add(2,2)} [],    "No warning to calc 2+2"; # what reads better :-)
33   
34       warning_like  {foo(-dri => "/"} qr/unknown param/i, "an unknown parameter test";
35       warnings_like {bar(1,1)} [qr/width.*small/i, qr/height.*small/i];
36   
37       warning_is    {foo()} {carped => 'didn't found the right parameters'};
38       warnings_like {foo()} [qr/undefined/,qr/undefined/,{carped => qr/no result/i}];
39   
40       warning_like {foo(undef)}                 'uninitialized';
41       warning_like {bar(file => '/etc/passwd')} 'io';
42
43       warning_like {eval q/"$x"; $x;/} 
44                    [qw/void uninitialized/], 
45                    "some warnings at compile time";
46
47 DESCRIPTION
48     This module provides a few convenience methods for testing warning based
49     code.
50
51     If you are not already familiar with the Test::More manpage now would be
52     the time to go take a look.
53
54   FUNCTIONS - OVERVIEW
55     warning_is    BLOCK STRING,   TEST_NAME
56     warnings_are  BLOCK ARRAYREF, TEST_NAME
57     warning_like  BLOCK REGEXP,   TEST_NAME
58     warning_like  BLOCK STRING,   TEST_NAME
59     warnings_like BLOCK ARRAYREF, TEST_NAME
60
61 SEE ALSO
62     Have a look to the similar Test::Exception module.
63
64 THANKS
65     Many thanks to Adrian Howard, chromatic and Michael G. Schwern, who all had
66     given me a lot of ideas.
67
68 AUTHOR
69     Janek Schleicher, <bigj@kamelfreund.de>
70
71 COPYRIGHT AND LICENSE
72     Copyright 2002 by Janek Schleicher
73
74     This library is free software; you can redistribute it and/or modify it
75     under the same terms as Perl itself.
76