@@ -117,12 +117,34 @@ func (suite *GitHubPublicTestSuite) TestParseOk() {
117117 href : "https://raw.githubusercontent.com/retr0h/git-url-parse/main/files/file0.json" ,
118118 },
119119 },
120+ {
121+ input : "https://www.github.com/retr0h/git-url-parse" ,
122+ want : & url {
123+ protocol : "https" ,
124+ resource : "www.github.com" ,
125+ owner : "retr0h" ,
126+ repo : "git-url-parse" ,
127+ path : "" ,
128+ branch : "" ,
129+ provider : "github" ,
130+ href : "https://www.github.com/retr0h/git-url-parse" ,
131+ },
132+ },
133+ {
134+ input :
"[email protected] :retr0h/git-url-parse.git" ,
135+ want : & url {
136+ protocol : "git" ,
137+ resource : "github.com" ,
138+ owner : "retr0h" ,
139+ repo : "git-url-parse" ,
140+ path : "" ,
141+ branch : "" ,
142+ provider : "github" ,
143+ href :
"[email protected] :retr0h/git-url-parse.git" ,
144+ },
145+ },
120146 }
121147
122- // "[email protected] :retr0h/git-url-parse.git" 123- // "[email protected] :foobar/retr0h/git-url-parse.git" 124- // "https://www.github.com/retr0h/git-url-parse"
125-
126148 for _ , tc := range tests {
127149 var got internal.RepositoryURLManager
128150 got , err := suite .rm .Parse (tc .input )
@@ -154,6 +176,13 @@ func (suite *GitHubPublicTestSuite) TestParseFails() {
154176 input : "bogus://url/" ,
155177 want : fmt .Sprintf ("could match url: %s to any pattern" , "bogus://url/" ),
156178 },
179+ {
180+ input :
"[email protected] :foobar/retr0h/git-url-parse.git" ,
181+ want : fmt .Sprintf (
182+ "could match url: %s to any pattern" ,
183+ "[email protected] :foobar/retr0h/git-url-parse.git" ,
184+ ),
185+ },
157186 }
158187
159188 for _ , tc := range tests {
0 commit comments