chore(test): add a rapid property test for the --file case and backslash rules
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 72/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 0
- Fork
- 0
- Merge medio
- 7h 42m
- PR unite (30g)
- 111
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di seanb4t/codegraph-go
-
chore needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
seanb4t/codegraph-go#380 ·
I maintainer di solito rispondono entro 1 giorno
-
chore needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
seanb4t/codegraph-go#379 ·
I maintainer di solito rispondono entro 1 giorno
-
area:query chore needs-triage spec-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
seanb4t/codegraph-go#377 ·
I maintainer di solito rispondono entro 1 giorno
-
chore needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
seanb4t/codegraph-go#362 ·
I maintainer di solito rispondono entro 1 giorno
-
area:query bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
seanb4t/codegraph-go#355 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di seanb4t/codegraph-go
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
automated documentation maintenance
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
github/gh-aw-mcpg#16717 ·
I maintainer di solito rispondono entro 1 giorno
-
Docs: Recording rules pages don't say what happens to a recorded metric when its rule is deletedApertainternal
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
jesseduffield/lazygit#6229 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
prometheus/prometheus#20482 ·
I maintainer di solito rispondono entro 2 giorni