Commit Graph

2 Commits

Author SHA1 Message Date
Abhinav Gupta
ac8ef9b9e3 test: replace manual os.Chdir with t.Chdir in tests (#457)
Replaces manual working directory save/restore patterns
with Go's built-in `t.Chdir()` helper across 23 test files.

The manual pattern involved calling `os.Getwd()` to save
the original directory, using `defer os.Chdir(origWd)` for
restoration, and manually handling errors during directory
changes. This boilerplate has been replaced with single
`t.Chdir(path)` calls that handle cleanup automatically.

The `t.Chdir()` method automatically restores the working
directory when the test completes, eliminating the need for
manual defer statements and error handling.

Total:
~75 instances replaced (assuming Claude's math is right)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-04 11:21:43 -08:00
Steve Yegge
76069a09dc Improve cmd/bd test coverage from 21% to 23.1% (bd-27ea)
Added comprehensive tests for:
- validate.go (parseChecks, validation results, orphaned deps, duplicates, git conflicts)
- restore.go (readIssueFromJSONL, git helpers)
- sync.go (git helpers, JSONL counting)

Progress: 21.0% → 23.1% (+2.1%)
Target: 40% (multi-session effort)
Amp-Thread-ID: https://ampcode.com/threads/T-540ebf64-e14f-4541-b098-586d2b07dc3e
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 19:44:43 -07:00