-
Notifications
You must be signed in to change notification settings - Fork 16
Provide explicit undef to indicate TODO condition is not met #30
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
base: master
Are you sure you want to change the base?
Conversation
... rather than implicit empty string (false but defined). Reflects change in Test-Simple distribution 1.302160, which is now incorporated into perl-5.29.7. See: Test-More/test-more@9c269ff
isa_ok($got, 'version') or $errs++ if defined $expected_version; | ||
} | ||
|
||
if (ref($expected_version) eq 'CODE') { | ||
local $TODO = $test_case->{TODO_code_sub}; | ||
local $TODO = $test_case->{TODO_code_sub} || undef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't need to be changed - $test_case->{TODO_code_sub}
is never defined-but-false.
ok( | ||
$expected_version->($got), | ||
"case '$test_case->{name}': module version passes match sub" | ||
) | ||
or $errs++; | ||
} | ||
else { | ||
local $TODO = $test_case->{TODO_scalar}; | ||
local $TODO = $test_case->{TODO_scalar} || undef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as TODO_code_sub
.
@@ -673,7 +673,7 @@ foreach my $test_case (@modules) { | |||
} | |||
|
|||
if (exists $test_case->{all_versions}) { | |||
local $TODO = $test_case->{TODO_all_versions}; | |||
local $TODO = $test_case->{TODO_all_versions} || undef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as TODO_code_sub
.
@@ -648,20 +648,20 @@ foreach my $test_case (@modules) { | |||
# We want to ensure we preserve the original, as long as it's legal, so we | |||
# explicitly check the stringified form. | |||
{ | |||
local $TODO = !defined($got) && ($test_case->{TODO_code_sub} || $test_case->{TODO_scalar}); | |||
local $TODO = !defined($got) && ($test_case->{TODO_code_sub} || $test_case->{TODO_scalar}) || undef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more strict than the original, but if the change is consequential it will result in more tests failing due to a lack of a TODO_*
where there should be one, so it should make the problem more apparent. (That is, I think this change is not harmful.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry to Changes
, as per the travis failures.
On 1/20/19 4:42 PM, Karen Etheridge wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In t/extract-version.t
<#30 (comment)>:
> isa_ok($got, 'version') or $errs++ if defined $expected_version;
}
if (ref($expected_version) eq 'CODE') {
- local $TODO = $test_case->{TODO_code_sub};
+ local $TODO = $test_case->{TODO_code_sub} || undef;
This line shouldn't need to be changed - |$test_case->{TODO_code_sub}|
is never defined-but-false.
------------------------------------------------------------------------
In t/extract-version.t
<#30 (comment)>:
> ok(
$expected_version->($got),
"case '$test_case->{name}': module version passes match sub"
)
or $errs++;
}
else {
- local $TODO = $test_case->{TODO_scalar};
+ local $TODO = $test_case->{TODO_scalar} || undef;
same as |TODO_code_sub|.
------------------------------------------------------------------------
In t/extract-version.t
<#30 (comment)>:
> @@ -673,7 +673,7 @@ foreach my $test_case ***@***.***) {
}
if (exists $test_case->{all_versions}) {
- local $TODO = $test_case->{TODO_all_versions};
+ local $TODO = $test_case->{TODO_all_versions} || undef;
same as |TODO_code_sub|.
------------------------------------------------------------------------
In t/extract-version.t
<#30 (comment)>:
> @@ -648,20 +648,20 @@ foreach my $test_case ***@***.***) {
# We want to ensure we preserve the original, as long as it's legal, so we
# explicitly check the stringified form.
{
- local $TODO = !defined($got) && ($test_case->{TODO_code_sub} || $test_case->{TODO_scalar});
+ local $TODO = !defined($got) && ($test_case->{TODO_code_sub} || $test_case->{TODO_scalar}) || undef;
This is more strict than the original, but if the change is
consequential it will result in more tests failing due to a lack of a
|TODO_*| where there should be one, so it should make the problem more
apparent. (That is, I think this change is not harmful.)
Sorry, swamped with projects. Won't have time to look into this further.
|
... rather than implicit empty string (false but defined).
Reflects change in Test-Simple distribution 1.302160, which is now
incorporated into perl-5.29.7.
See: Test-More/test-more@9c269ff