Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows

Open Beginner friendly
#24 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
cli, testing

Research direction

Read internal/tools/tools_test.go at TestRunCommandHelper_RejectsPathEscapingRoot and trace how run_command validates its path argument with Go's filepath.IsAbs. Decide how Windows rooted paths should be handled, then run that test on Windows and another platform. Done when the test has consistent, intentional expectations across platforms and passes.

Written by the indexing model from the issue text.

Description

TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows.

What happens

The test passes "/etc" as the path argument to run_command and expects an error result before any confirm prompt. On Windows, /etc is not an absolute path to filepath.IsAbs, so the path is not rejected there. The command reaches the interactive y/n confirm instead, and the test gets a different result.

The other three cases in the same test (../outside, a/../../etc, sub/../../secrets) pass on Windows.

Where this showed up

  • Seen on Windows in #21 and #23 (each PR's test run). Both PR authors noted that the same failure happens on the base branch (1bff3df in #23).
  • The test is in internal/tools/tools_test.go at TestRunCommandHelper_RejectsPathEscapingRoot.

Suggested direction

Decide what "absolute" means for path arguments on Windows. Either treat a leading / or \ as rooted when checking path (so /etc is rejected on every platform), or change the test to use a Windows-absolute path such as C:\Windows on Windows only. The first keeps one expectation across platforms.

I have not run this on the current main (335144d); the report above is from the PR runs.

Dominant language
Go
Stars
1
Forks
2
Avg merge
18h 26m
Merged PRs (30d)
11

Getting set up

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.

More from Edwin-metcalf/MetCode

All issues in Edwin-metcalf/MetCode

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.