Test::Warn

Latest version: 0.37 registry icon
Maintenance score
0
Safety score
0
Popularity score
5
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.37 0 0 0 0 0
0.36 0 0 0 0 0
0.35 0 0 0 0 0
0.34 0 0 0 0 0
0.33 0 0 0 0 0
0.32 0 0 0 0 0
0.31 0 0 0 0 0
0.08 0 0 0 0 0
0.07 0 0 0 0 0
0.06 0 0 0 0 0
0.05 0 0 0 0 0
0.04 0 0 0 0 0
0.03 0 0 0 0 0
0.02 0 0 0 0 0
0.01 0 0 0 0 0

Stability
Latest release:

0.37 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Artistic-1.0   -   Artistic License 1.0

Not a wildcard

Not proprietary

OSI Compliant


GPL-1.0-or-later   -   GNU General Public License v1.0 or later

Not a wildcard

Not proprietary

OSI Compliant



Test/Warn version 0.37

INSTALLATION

To install this module type the following: cpan Test::Warn

or

perl Makefile.PL make make test make install

DEPENDENCIES

This module requires these other modules and libraries:

Test::Builder Sub::Uplevel File::Spec

SYNOPSIS

  use Test::Warn;

  warning_is    {foo(-dri => "/")} "Unknown Parameter 'dri'", "dri != dir gives warning";
  warnings_are  {bar(1,1)} ["Width very small", "Height very small"];

  warning_is    {add(2,2)} undef, "No warning to calc 2+2"; # or
  warnings_are  {add(2,2)} [],    "No warning to calc 2+2"; # what reads better :-)

  warning_like  {foo(-dri => "/"} qr/unknown param/i, "an unknown parameter test";
  warnings_like {bar(1,1)} [qr/width.*small/i, qr/height.*small/i];

  warning_is    {foo()} {carped => 'didn't found the right parameters'};
  warnings_like {foo()} [qr/undefined/,qr/undefined/,{carped => qr/no result/i}];

  warning_like {foo(undef)}                 'uninitialized';
  warning_like {bar(file => '/etc/passwd')} 'io';

  warning_like {eval q/"$x"; $x;/}
               [qw/void uninitialized/],
               "some warnings at compile time";

DESCRIPTION

This module provides a few convenience methods for testing warning based
code.

If you are not already familiar with the Test::More manpage now would be
the time to go take a look.

FUNCTIONS - OVERVIEW warning_is BLOCK STRING, TEST_NAME warnings_are BLOCK ARRAYREF, TEST_NAME warning_like BLOCK REGEXP, TEST_NAME warning_like BLOCK STRING, TEST_NAME warnings_like BLOCK ARRAYREF, TEST_NAME

SEE ALSO Have a look to the similar Test::Exception module.

THANKS Many thanks to Adrian Howard, chromatic and Michael G. Schwern, who have given me a lot of ideas.

AUTHOR Janek Schleicher, bigj@kamelfreund.de

COPYRIGHT AND LICENSE Copyright 2002 by Janek Schleicher Copyright 2007-2016 by Alexandr Ciornii Copyright 2016-2018 by Janek Schleicher

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.