Test-More / Test-More/test-more

array, bag, and hash are vulnerable to a very easy mistake

Open
#993 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
149
Forks
98
PR merge metrics
No merged PRs in 30d

Description

use Test2::Bundle::Extended;

is {foo => 23}, hash  { bar => 42 };  # passes?!
is [1,2,3],     array { 5, 6, 7 };    # passes?!
is [1,2,3],     bag   { 5, 6, 7 };    # passes?!

done_testing;

Those all pass. I understand technically why, they're all equivalent to an empty block, but it's very confusing to the user.

I'm not sure what to do about it, but Test-More/Test2-Suite#56 will help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Test2::Bundle::Extended examples in the issue and compare the behavior with Test-More/Test2-Suite#56. Determine the intended handling of empty blocks for hash, array, and bag assertions; done requires an agreed behavior covered by tests rather than silently accepting these mistakes.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.