You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/perl
use warnings;
use strict;
use 5.010;
use experimental 'signatures';
use Test::More tests => 1;
use Test::Vars;
vars_ok( 'lib/foo.pm' );
exit 0;
When I run the test, the test passes, although there are three unused vars in lib/foo.pm.
The text was updated successfully, but these errors were encountered:
NOTE: This patch is for research; it's not ready to be committed to
master.
In houseabsolute#44, it was
argued that vars_ok() should have failed on a .pm file that simply
declared three 'my' variables but never used them and never did anything
else. vars_ok() returns '1' (as do the previous invocations of
vars_ok() in the test file) where we would have expected it to return a
Perl-false value.
This patch attempts to bring that observation into the test suite in the
form of a TODO test. However, we're hampered by the fact that the
return value of vars_ok() is at best opaquely documented. What we
really need is a function along the lines of:
vars_not_expected_to_be_ok('path/to/file');
Here's my lib/foo.pm
and here's my foo.t
When I run the test, the test passes, although there are three unused vars in lib/foo.pm.
The text was updated successfully, but these errors were encountered: