Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions are swallowed when tests exceed count #38

Open
szabgab opened this issue Feb 23, 2021 · 0 comments
Open

Exceptions are swallowed when tests exceed count #38

szabgab opened this issue Feb 23, 2021 · 0 comments

Comments

@szabgab
Copy link
Collaborator

szabgab commented Feb 23, 2021

Sample script:

package Test;

use Test::More;
plan tests => 1;

use parent qw( Test::Class );

sub mytest : Tests(1) {
    ok 1;
    ok 1;

    die 123123;
}

__PACKAGE__->new()->runtests();

Less contrived, what-actually-bit-me variant:

#!/usr/bin/env perl

use strict;
use warnings;

sub new { bless [] }

sub throw { die '~~~~~~~~~~~~~~ threw' }

sub DESTROY { die 'DESTROYed' }
package Test;

use Test::More;
use Test::FailWarnings;
plan tests => 1;

use parent qw( Test::Class );

sub mytest : Tests(1) {
    ok 1;

    my $thing = main->new();
    $thing->throw();
}

__PACKAGE__->new()->runtests();

================

EASY FIX:

Take the _exception_failure(…) invocation from the $num_done == $num_expected case, and make that execute in the $num_done > $num_expected case as well.

Thank you!

-FG

Original: https://rt.cpan.org/Ticket/Display.html?id=128402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant