indiana91 / indiana91/devstandup

Add Unit Tests for Git Analyzer

Open
#4 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
No language data
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Write unit tests for the `internal/git/analyzer.go` file to ensure commit analysis works correctly.

**Tasks:**
- [ ] Create `analyzer_test.go` file
- [ ] Write test for parsing commit messages
- [ ] Write test for calculating statistics (additions, deletions)
- [ ] Write test for filtering commits by date range
- [ ] Write test for filtering commits by author
- [ ] Achieve at least 80% code coverage

**Acceptance Criteria:**
- All tests pass with `go test ./internal/git/...`
- Code coverage is at least 80%
- Tests include edge cases (empty repos, no commits, etc.)

**Resources:**
- Go Testing: https://go.dev/doc/tutorial/add-a-test
- Table-driven tests: https://go.dev/wiki/TableDrivenTests

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading internal/git/analyzer.go and identify the commit parsing, statistics, date filtering, and author filtering paths. Create internal/git/analyzer_test.go with table-driven and edge-case tests, then run go test ./internal/git/... and verify coverage reaches at least 80%.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.