Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

perl-Test-Exception-0.430000-1.22 RPM for noarch

From OpenSuSE Leap 15.5 for noarch

Name: perl-Test-Exception Distribution: SUSE Linux Enterprise 15
Version: 0.430000 Vendor: SUSE LLC <https://www.suse.com/>
Release: 1.22 Build date: Fri May 25 20:23:14 2018
Group: Development/Libraries/Perl Build host: sheep64
Size: 29807 Source RPM: perl-Test-Exception-0.430000-1.22.src.rpm
Packager: https://www.suse.com/
Url: http://search.cpan.org/dist/Test-Exception/
Summary: Test exception-based code
This module provides a few convenience methods for testing exception based
code. It is built with Test::Builder and plays happily with Test::More and
friends.

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

You can specify the test plan when you 'use Test::Exception' in the same
way as 'use Test::More'. See Test::More for details.

NOTE: Test::Exception only checks for exceptions. It will ignore other
methods of stopping program execution - including exit(). If you have an
exit() in evalled code Test::Exception will not catch this with any of its
testing functions.

NOTE: This module uses Sub::Uplevel and relies on overriding
'CORE::GLOBAL::caller' to hide your test blocks from the call stack. If
this use of global overrides concerns you, the Test::Fatal module offers a
more minimalist alternative.

* *throws_ok*

Tests to see that a specific exception is thrown. throws_ok() has two
forms:

  throws_ok BLOCK REGEX, TEST_DESCRIPTION
  throws_ok BLOCK CLASS, TEST_DESCRIPTION

In the first form the test passes if the stringified exception matches the
give regular expression. For example:

    throws_ok { read_file( 'unreadable' ) } qr/No file/, 'no file';

If your perl does not support 'qr//' you can also pass a regex-like string,
for example:

    throws_ok { read_file( 'unreadable' ) } '/No file/', 'no file';

The second form of throws_ok() test passes if the exception is of the same
class as the one supplied, or a subclass of that class. For example:

    throws_ok { $foo->bar } "Error::Simple", 'simple error';

Will only pass if the 'bar' method throws an Error::Simple exception, or a
subclass of an Error::Simple exception.

You can get the same effect by passing an instance of the exception you
want to look for. The following is equivalent to the previous example:

    my $SIMPLE = Error::Simple->new;
    throws_ok { $foo->bar } $SIMPLE, 'simple error';

Should a throws_ok() test fail it produces appropriate diagnostic messages.
For example:

    not ok 3 - simple error
    
    
    

Like all other Test::Exception functions you can avoid prototypes by
passing a subroutine explicitly:

    throws_ok( sub {$foo->bar}, "Error::Simple", 'simple error' );

A true value is returned if the test succeeds, false otherwise. On exit $@
is guaranteed to be the cause of death (if any).

A description of the exception being checked is used if no optional test
description is passed.

NOTE: Remember when you 'die $string_without_a_trailing_newline' perl will
automatically add the current script line number, input line number and a
newline. This will form part of the string that throws_ok regular
expressions match against.

* *dies_ok*

Checks that a piece of code dies, rather than returning normally. For
example:

    sub div {
        my ( $a, $b ) = @_;
        return $a / $b;
    };

    dies_ok { div( 1, 0 ) } 'divide by zero detected';

    
    dies_ok( sub { div( 1, 0 ) }, 'divide by zero detected' );

A true value is returned if the test succeeds, false otherwise. On exit $@
is guaranteed to be the cause of death (if any).

Remember: This test will pass if the code dies for any reason. If you care
about the reason it might be more sensible to write a more specific test
using throws_ok().

The test description is optional, but recommended.

* *lives_ok*

Checks that a piece of code doesn't die. This allows your test script to
continue, rather than aborting if you get an unexpected exception. For
example:

    sub read_file {
        my $file = shift;
        local $/;
        open my $fh, '<', $file or die "open failed ($!)\n";
        $file = <FILE>;
        return $file;
    };

    my $file;
    lives_ok { $file = read_file('test.txt') } 'file read';

    
    lives_ok( sub { $file = read_file('test.txt') }, 'file read' );

Should a lives_ok() test fail it produces appropriate diagnostic messages.
For example:

    not ok 1 - file read
    
    

A true value is returned if the test succeeds, false otherwise. On exit $@
is guaranteed to be the cause of death (if any).

The test description is optional, but recommended.

* *lives_and*

Run a test that may throw an exception. For example, instead of doing:

  my $file;
  lives_ok { $file = read_file('answer.txt') } 'read_file worked';
  is $file, "42", 'answer was 42';

You can use lives_and() like this:

  lives_and { is read_file('answer.txt'), "42" } 'answer is 42';
  
  lives_and(sub {is read_file('answer.txt'), "42"}, 'answer is 42');

Which is the same as doing

  is read_file('answer.txt'), "42\n", 'answer is 42';

unless 'read_file('answer.txt')' dies, in which case you get the same kind
of error as lives_ok()

  not ok 1 - answer is 42
  
  

A true value is returned if the test succeeds, false otherwise. On exit $@
is guaranteed to be the cause of death (if any).

The test description is optional, but recommended.

Provides

Requires

License

Artistic-1.0 or GPL-1.0+

Changelog

* Sat Jan 02 2016 coolo@suse.com
  - updated to 0.43
    see /usr/share/doc/packages/perl-Test-Exception/Changes
* Sat Dec 26 2015 coolo@suse.com
  - updated to 0.41
    see /usr/share/doc/packages/perl-Test-Exception/Changes
    0.40   [2015-12-21]
    - Updated for Test2
* Sun Jun 07 2015 coolo@suse.com
  - updated to 0.40
    see /usr/share/doc/packages/perl-Test-Exception/Changes
    0.40   [2015-06-05]
    - Updated for changes in Test::Stream (Use Test::Stream::Sync)
    0.39   [2015-06-04]
    - Updated for changes in Test::Stream
* Thu Apr 23 2015 coolo@suse.com
  - extend version to 6 digits to avoid problems with > 0.331
* Mon Apr 13 2015 coolo@suse.com
  - updated to 0.38
    see /usr/share/doc/packages/perl-Test-Exception/Changes
    0.38   [2015-02-27]
    - fixed repository link in metadata
    0.37   [2015-02-27]
    - distribution is now managed by ExtUtils::MakeMaker (RT#102054)
* Fri Feb 06 2015 coolo@suse.com
  - updated to 0.36
    - Fix bug when Test::More has been downgraded
    0.35   [2014-09-20]
    - Fix a bug when Test::Builder isn't new (better version).
    0.34   [2014-09-20]
    - Fix a bug when Test::Builder isn't new.
    0.33   [2014-09-19] Or "Another Test-Simple change"
    - Fixed test broken by changes in Test::Builder and friends
* Tue Jun 04 2013 coolo@suse.com
  - updated to 0.32
    Fixed tests that broke due to Test::More diagnostic changes
* Mon Apr 15 2013 idonmez@suse.com
  - Add Source URL, see https://en.opensuse.org/SourceUrls
* Fri Nov 18 2011 coolo@suse.com
  - use original .tar.gz
* Tue Aug 30 2011 andrea.turrini@gmail.com
  - standardized "Authors:" format in description of
    perl-Test-Exception.spec
* Wed Dec 01 2010 coolo@novell.com
  - switch to perl_requires macro
* Fri Oct 15 2010 anicka@suse.cz
  - update to 0.31
    - Added a bunch of folk to the acknowledgements
    - Added some clarifying documentation to respond to RT#59293
    - Marked a test that was failing under T::B 2.0 until we figure out
      whether it should pass or not. See http://is.gd/fNOFb
    - Added dates to changes file, as far as we can from backpan et al
    - Fix for DB::args bug (thanks Peter Rabbitson)
    - Fix for bizarre-copy bug (thanks Peter Rabbitson)
* Wed Jan 13 2010 anicka@suse.cz
  - update to 0.29
    * Patch to fix code with Sub::Uplevel again.
* Sun Dec 20 2009 jengelh@medozas.de
  - enable parallel build
* Sat Jul 25 2009 chris@computersalat.de
  - spec mods
    * removed ^----------
    * removed ^#---------
* Tue Jul 14 2009 chris@computersalat.de
  - fixed deps
    o Req for Test::Builder
* Wed Jul 01 2009 chris@computersalat.de
  - added perl-macros
    o autogen filelist with perl_gen_filelist
  - spec mods
    o added header
    o fixed deps

Files

/usr/lib/perl5/vendor_perl/5.26.1/Test
/usr/lib/perl5/vendor_perl/5.26.1/Test/Exception.pm
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/share/doc/packages/perl-Test-Exception
/usr/share/doc/packages/perl-Test-Exception/Changes
/usr/share/man/man3/Test::Exception.3pm.gz


Generated by rpm2html 1.8.1

Fabrice Bellet, Tue Apr 9 19:57:54 2024