Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows

オープン 初心者向け
#24 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
cli, testing

調査の方向性

internal/tools/tools_test.go の TestRunCommandHelper_RejectsPathEscapingRoot を読み、run_command が Go の filepath.IsAbs を使って引数 path をどのように検証するかを追ってください。Windows のルート付きパスをどう扱うべきかを決め、そのテストを Windows と別のプラットフォームで実行してください。テストの期待値がすべてのプラットフォームで一貫した意図的なものとなり、成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
1
フォーク
2
平均マージ
13時間 15分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Edwin-metcalf/MetCode のほかの issue

Edwin-metcalf/MetCode の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。