MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsValidGitHubRepositoryName

Function TestIsValidGitHubRepositoryName

pkg/parser/github_urls_test.go:840–876  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

838}
839
840func TestIsValidGitHubRepositoryName(t *testing.T) {
841 tests := []struct {
842 name string
843 input string
844 want bool
845 }{
846 {
847 name: "Valid short name",
848 input: "repo",
849 want: true,
850 },
851 {
852 name: "Valid long hyphenated name",
853 input: "long-repository-name-with-many-hyphens-that-exceeds-thirty-nine-characters",
854 want: true,
855 },
856 {
857 name: "Invalid too long name",
858 input: "this-repository-name-is-intentionally-very-long-to-exceed-the-github-repository-name-limit-of-one-hundred-characters-total",
859 want: false,
860 },
861 {
862 name: "Invalid starts with hyphen",
863 input: "-repo",
864 want: false,
865 },
866 }
867
868 for _, tt := range tests {
869 t.Run(tt.name, func(t *testing.T) {
870 got := IsValidGitHubRepositoryName(tt.input)
871 if got != tt.want {
872 t.Errorf("IsValidGitHubRepositoryName() = %v, want %v", got, tt.want)
873 }
874 })
875 }
876}
877
878// TestParseGitHubURL_AdditionalEdgeCases tests additional edge cases for comprehensive coverage
879func TestParseGitHubURL_AdditionalEdgeCases(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected