Provide explicit undef to indicate TODO condition is not met#30
Open
Provide explicit undef to indicate TODO condition is not met#30
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
|
|
||
| if (ref($expected_version) eq 'CODE') { | ||
| local $TODO = $test_case->{TODO_code_sub}; | ||
| local $TODO = $test_case->{TODO_code_sub} || undef; |
Member
There was a problem hiding this comment.
This line shouldn't need to be changed - $test_case->{TODO_code_sub} is never defined-but-false.
| } | ||
| else { | ||
| local $TODO = $test_case->{TODO_scalar}; | ||
| local $TODO = $test_case->{TODO_scalar} || undef; |
|
|
||
| if (exists $test_case->{all_versions}) { | ||
| local $TODO = $test_case->{TODO_all_versions}; | ||
| local $TODO = $test_case->{TODO_all_versions} || undef; |
| # 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; |
Member
There was a problem hiding this comment.
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.)
Member
karenetheridge
left a comment
There was a problem hiding this comment.
Please add an entry to Changes, as per the travis failures.
Author
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
... 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