Help for this page

Select Code to Download


  1. or download this
    use Test::Exception;
    
    dies_ok { testsub("die") } "Dies on inappropriate input";
    throws_ok { testsub("die screaming") } qr/arrrgh/, "Dies with appropri
    +ate error message";
    lives_ok { testsub("survive") } "Survives with appropriate input";
    
  2. or download this
    use Test::Warn;
    
    warning_is { testsub("complain") } qr/nag/, "Gives a specific warning"
    +;
    warning_is { testsub("quiet") undef, "No warnings given";
    
  3. or download this
    use Test::NoWarnings;