6 To install this module type the following:
15 This module requires these other modules and libraries:
28 warning_is {foo(-dri => "/")} "Unknown Parameter 'dri'", "dri != dir gives warning";
29 warnings_are {bar(1,1)} ["Width very small", "Height very small"];
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 :-)
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];
37 warning_is {foo()} {carped => 'didn't found the right parameters'};
38 warnings_like {foo()} [qr/undefined/,qr/undefined/,{carped => qr/no result/i}];
40 warning_like {foo(undef)} 'uninitialized';
41 warning_like {bar(file => '/etc/passwd')} 'io';
43 warning_like {eval q/"$x"; $x;/}
44 [qw/void uninitialized/],
45 "some warnings at compile time";
48 This module provides a few convenience methods for testing warning based
51 If you are not already familiar with the Test::More manpage now would be
52 the time to go take a look.
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
62 Have a look to the similar Test::Exception module.
65 Many thanks to Adrian Howard, chromatic and Michael G. Schwern, who all had
66 given me a lot of ideas.
69 Janek Schleicher, <bigj@kamelfreund.de>
72 Copyright 2002 by Janek Schleicher
74 This library is free software; you can redistribute it and/or modify it
75 under the same terms as Perl itself.