Skip to content

test: add unit tests for getRepoName with various git URL formats#18

Merged
timvw merged 2 commits into
mainfrom
test-getreponame-f4a
Dec 1, 2025
Merged

test: add unit tests for getRepoName with various git URL formats#18
timvw merged 2 commits into
mainfrom
test-getreponame-f4a

Conversation

@timvw
Copy link
Copy Markdown
Owner

@timvw timvw commented Nov 30, 2025

Summary

  • Add TestGetRepoName: validates the function works in current repository context
  • Add TestExtractRepoNameFromURL: comprehensive test with 22 test cases covering various git URL formats
  • Test coverage includes GitHub, GitLab, Bitbucket, Azure DevOps, and self-hosted git URLs
  • Tests both HTTPS and SSH URL formats
  • Tests URLs with and without .git suffix
  • Tests edge cases like trailing slashes, special characters, and multiple .git occurrences

Test plan

  • All tests pass locally (go test -v)
  • Wait for CI checks to pass

Resolves beads-oss-tasks-f4a

🤖 Generated with Claude Code

Add comprehensive test coverage for getRepoName function:
- TestGetRepoName: validates the function works in current repo context
- TestExtractRepoNameFromURL: tests URL parsing logic with 22 test cases
  covering GitHub, GitLab, Bitbucket, Azure DevOps, and self-hosted URLs
  in both HTTPS and SSH formats, with and without .git suffix

Resolves beads-oss-tasks-f4a

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.72%. Comparing base (ce04bd4) to head (387bffa).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   18.09%   19.72%   +1.62%     
==========================================
  Files           1        1              
  Lines         431      431              
==========================================
+ Hits           78       85       +7     
+ Misses        348      341       -7     
  Partials        5        5              

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@timvw timvw merged commit 6ed8cd8 into main Dec 1, 2025
11 checks passed
@timvw timvw deleted the test-getreponame-f4a branch December 1, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant