Test-More / Test-More/test-more

`require_ok "open"` fails

Open
#889 4 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

require_ok "open" fails by trying to use the open operator.

This can be resolved by replacing

    # Try to determine if we've been given a module name or file.
    # Module names must be barewords, files not.
    $module = qq['$module'] unless _is_module_name($module);
 
    my $code = <<REQUIRE;
package $pack;
require $module;
1;
REQUIRE

with

    # Try to determine if we've been given a module name or file.
    # Module names must be barewords, files not.
    my $code = ( _is_module_name($module)
        ? "require '$module'"
        : "use $module ()"
    );
 
    $code = <<REQUIRE;
package $pack;
$code;
1;
REQUIRE

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 at the implementation of require_ok and reproduce the failure with the module name "open". Add regression coverage for this case, then run the relevant Perl test suite; done means require_ok "open" succeeds without invoking the open operator.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.