call matches U for DNE is confusing.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
The issue provides a Perl reproducer showing that a misspelled method returning DNE matches U(); start by running this example and tracing the object matcher behavior involved in method calls. Done should provide a way to distinguish a method that returns undef from a method that does not exist, with tests covering both cases.
Written by the indexing model from the issue text.
Description
This is bit me a couple of times:
use Test2::V0;
package Foo {
sub new { bless {}, __PACKAGE__ }
sub bar { return undef; }
};
is(
Foo->new,
object {
call baar => U();
},
);
done_testing;
This passes because calling typo'd baar results in DNE which matches U. This makes sense for consistency with testing other types of objects, but I'm not sure if there is a way to test a method that returns undef without getting a pass on a method that does not exist.
- Dominant language
- Perl
- Stars
- 149
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Test-More/test-more
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
All issues in Test-More/test-more
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stfc/cloud-image-builders#218 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
0.kind: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Role::Serializer: class-method deserialize failure raises Class::XSAccessor, masking the real error OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
PerlDancer/Dancer2#1837 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100