Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

abctl: the casefold breakdown test's second assertion is unreachable on its own fixture

Aperta Adatta ai principianti
#1,179 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli, testing-qa

Direzione di ricerca

Leggi cmd/abctl/cmd_cost_test.go ed esamina TestRunCost_ByCurrencyMatchesAUnitSpelledADifferentWay, in particolare il suo fixture Credits con una sola voce e entrambe le assertions. Conferma quale assertion è irraggiungibile, quindi rendi chiara l'unica affermazione del test aggiungendo un fixture realmente misto oppure rimuovendo l'assertion morta; il test deve coprire correttamente il comportamento di casefold senza implicare un percorso non testato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Found by the round-3 strict review of #1153, in a test that PR's round 2 added.

cmd/abctl/cmd_cost_test.go, TestRunCost_ByCurrencyMatchesAUnitSpelledADifferentWay:

if strings.Contains(row, mixedCostCell) {
    t.Errorf("a real configured unit was withheld as unrecognised:\n%s", row)
}

The fixture carries "currencies":["Credits"] — one entry — so windowUnit returns labelled=true and writeCostBreakdown's default: cost = mixedCostCell arm is unreachable for a priced row. The assertion cannot fire on this input, and its stated reason ("withheld as unrecognised") describes a path the fixture does not reach.

The test's first assertion is live and does pin the property that matters (a unit spelled differently from the reported set keeps its label, i.e. isReportedUnit folds case). Only the negative twin is dead.

Fix is either a second fixture whose window is genuinely mixed, or dropping the assertion and saying in the comment that the single-unit fixture cannot produce (mixed). Prefer whichever keeps the test's one claim legible.

Assisted-By: Claude (Anthropic AI) [email protected]

Lingua principale
Go
Stelle
13
Fork
40
Merge medio
12h 3m
PR unite (30g)
199

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rossoctl/cortex

Tutte le issue di rossoctl/cortex

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.