chore(test): add a rapid property test for the --file case and backslash rules
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read filterByFile and normalizeNarrowPath in internal/query/node.go, then the two example tests TestCalleesWithTheEndOfAFilePath and TestCalleesWithABackslashFilePath in internal/query/definitions_test.go. Use TestFileSelectionPartitionsTheUnion and the drawGraph generator as the pattern for a rapid.Check test. Done when the new property test checks that the filter keeps exactly the file-bearing nodes whose normalized path contains the normalized hint, and that case and separator changes in the hint keep the same nodes, and go test ./internal/query/ passes.
索引モデルが issue の本文から書いたものです。
説明
What kind of chore?
Test infrastructure
What needs doing?
Add a rapid property test for the --file rules in filterByFile (internal/query/node.go:214). The rules ignore letter case and treat a backslash as a slash, through normalizeNarrowPath (internal/query/node.go:206).
Only two example tests cover these rules: TestCalleesWithTheEndOfAFilePath (internal/query/definitions_test.go:605) and TestCalleesWithABackslashFilePath (internal/query/definitions_test.go:624).
The property: the filter keeps a node that has a file and whose normalized path contains the normalized hint. It drops every other node. A hint that differs only in case or separators keeps the same nodes.
TestFileSelectionPartitionsTheUnion (internal/query/definitions_test.go:932) already uses rapid.Check, but it tests the partition of rows by file. It does not test the case or separator rules. The new test can reuse the graph generator drawGraph (internal/query/definitions_test.go:823).
Why now?
Each case the examples miss can drop rows from callers, callees and impact without an error. filterByFile documents that those commands use it as a hard filter (internal/query/node.go:210). A property test covers every case in the rule, not only the ones someone wrote down.
Issue #221 asks for property tests as part of its test cleanup. This change adds one test and does not change the scope of #221.
Does this touch anything load-bearing?
- The release pipeline (
release.yml,.goreleaser.yaml, signing) - The upgrade identity (
internal/upgrade/verify.go) - The perf baseline (
tools/bench/baseline.json) - The graph schema / meta-key layout
- None of these
Before submitting
- I searched existing issues and this is not a duplicate
🤖 Generated with Claude Code
- 主要言語
- Go
- スター
- 0
- フォーク
- 0
- 平均マージ
- 7時間 42分
- マージ済み PR(30日)
- 111
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
seanb4t/codegraph-go のほかの issue
-
chore needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
seanb4t/codegraph-go#380 ·
メンテナーはふだん 1 日以内に返信
-
chore needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
seanb4t/codegraph-go#379 ·
メンテナーはふだん 1 日以内に返信
-
area:query chore needs-triage spec-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
seanb4t/codegraph-go#377 ·
メンテナーはふだん 1 日以内に返信
-
chore needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
seanb4t/codegraph-go#362 ·
メンテナーはふだん 1 日以内に返信
-
area:query bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
seanb4t/codegraph-go#355 ·
メンテナーはふだん 1 日以内に返信
seanb4t/codegraph-go の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
automated documentation maintenance
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
github/gh-aw-mcpg#16717 ·
メンテナーはふだん 1 日以内に返信
-
Docs: Recording rules pages don't say what happens to a recorded metric when its rule is deletedオープンinternal
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jesseduffield/lazygit#6229 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
prometheus/prometheus#20482 ·
メンテナーはふだん 2 日以内に返信