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

num_method_tests() doesn’t work outside test module #34

Open
FGasper opened this issue Feb 10, 2020 · 0 comments
Open

num_method_tests() doesn’t work outside test module #34

FGasper opened this issue Feb 10, 2020 · 0 comments

Comments

@FGasper
Copy link

FGasper commented Feb 10, 2020

#!perl

use strict;
use warnings;

use Test::More;

package t::Base;

use base 'Test::Class';

sub mytest : Tests(2) {
}

package main;

is( t::Base->num_method_tests('mytest'), 2, 'num_method_tests()' );

done_testing();

This breaks with:

> prove -wlvm t/inheritance_count.t
t/inheritance_count.t ..
not called in a Test::Class at t/inheritance_count.t line 17.
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

Test Summary Report
-------------------
t/inheritance_count.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.04 cusr  0.00 csys =  0.07 CPU)
Result: FAIL

I’m not sure if this is fixable, but it‘s at least worth reporting.

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