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

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

Open Beginner friendly
#1,179 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
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli, testing-qa

Research direction

Read cmd/abctl/cmd_cost_test.go and inspect TestRunCost_ByCurrencyMatchesAUnitSpelledADifferentWay, especially its one-entry Credits fixture and both assertions. Confirm which assertion is unreachable, then make the test's single claim legible by either adding a genuinely mixed fixture or removing the dead assertion; the test should accurately cover the casefold behavior without implying an untested path.

Written by the indexing model from the issue text.

Description

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]

Dominant language
Go
Stars
13
Forks
40
Avg merge
11h 31m
Merged PRs (30d)
204

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 rossoctl/cortex

All issues in rossoctl/cortex

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.