Skip to content

test(ai): table-drive analyzer_test.go #142

Description

@btwshivam

internal/ai/analyzer_test.go has 11 Test* funcs and two small tables, so most cases are sequential. JSON extraction, markdown-fence stripping, and the degrade-to-plaintext path are a good table fit.

convert the sequential funcs into table-driven tests driven by t.Run(tc.name, ...). cover the boundaries: well-formed JSON, fenced json, a bare fence, malformed JSON (must degrade, not panic), and empty input. keep the current cases. heads-up that the ai package is in flux across #70/#85/#102, rebase after whichever lands.

mirror the two tables already here and internal/cli/trace_test.go. t.Parallel() is safe for the pure extraction cases.

Metadata

Metadata

Labels

claimedSomeone is actively working on this (auto-released after 10d inactivity)good first issueGood for newcomerstestingTests and test coverage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions