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

Enforce strict on testsuite #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

atoomic
Copy link
Member

@atoomic atoomic commented Aug 18, 2020

No description provided.

t/coretests.pm Outdated
ok(defined(&{"main\::$qv_declare"}), "make sure we exported $qv_declare() properly");
isa_ok( &$qv_declare(1.2), $package);
die "Error from test: $@" if $@;
ok(main->can($qv_declare), "make sure we exported $qv_declare() properly");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these need to be changed, and to be honest the old version is technically the more correct one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restored the previous version via 4948177

t/coretests.pm Outdated
@@ -338,7 +343,8 @@ SKIP: {
ok($version == $new_version, '$version == $new_version');
skip "version require'd instead of use'd, cannot test declare", 1
unless defined $qv_declare;
$version = &$qv_declare(1.2.3);

$version = main->can($qv_declare)->(1.2.3);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is indented incorrectly

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed via 590c618... unfortunately the whole indentation of this file is a mess... mixing spaces and tabs...
restored the "\t\s+" indentation used around the other lines to match

@atoomic atoomic force-pushed the strict++ branch 2 times, most recently from 590c618 to 4948177 Compare August 27, 2020 18:02
@Leont
Copy link
Collaborator

Leont commented Sep 23, 2020

Could you please change the ->can calls back to symbolic references? As we're dealing with functions here and not methods, the former seem more appropriate (and I can live with 'no strict refs' here)

@atoomic
Copy link
Member Author

atoomic commented Sep 23, 2020

@Leont I removed the ->can and add a few no strict 'refs' to preserve symbolic references.
I'm not sure what was wrong about using can on %main::

@haarg
Copy link
Contributor

haarg commented Sep 23, 2020

can is for finding methods and checks the inheritance chain. The subs being used in the tests are not methods, they are functions. While it's unlikely that main will have any parent classes (aside from UNIVERSAL and anything added to @UNIVERSAL::ISA), it's still more correct to check for the sub directly.

@Leont
Copy link
Collaborator

Leont commented Apr 28, 2024

This branch doesn't seem to apply anymore.

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

Successfully merging this pull request may close these issues.

3 participants