File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,13 @@ func Test_repoFromURL(t *testing.T) {
117117
118118func TestFromFullName (t * testing.T ) {
119119 tests := []struct {
120- name string
121- input string
122- wantOwner string
123- wantName string
124- wantHost string
125- wantErr error
120+ name string
121+ input string
122+ hostOverride string
123+ wantOwner string
124+ wantName string
125+ wantHost string
126+ wantErr error
126127 }{
127128 {
128129 name : "OWNER/REPO combo" ,
@@ -171,9 +172,30 @@ func TestFromFullName(t *testing.T) {
171172 wantName : "REPO" ,
172173 wantErr : nil ,
173174 },
175+ {
176+ name : "OWNER/REPO with default host override" ,
177+ input : "OWNER/REPO" ,
178+ hostOverride : "override.com" ,
179+ wantHost : "override.com" ,
180+ wantOwner : "OWNER" ,
181+ wantName : "REPO" ,
182+ wantErr : nil ,
183+ },
184+ {
185+ name : "HOST/OWNER/REPO with default host override" ,
186+ input : "example.com/OWNER/REPO" ,
187+ hostOverride : "override.com" ,
188+ wantHost : "example.com" ,
189+ wantOwner : "OWNER" ,
190+ wantName : "REPO" ,
191+ wantErr : nil ,
192+ },
174193 }
175194 for _ , tt := range tests {
176195 t .Run (tt .name , func (t * testing.T ) {
196+ if tt .hostOverride != "" {
197+ SetDefaultHost (tt .hostOverride )
198+ }
177199 r , err := FromFullName (tt .input )
178200 if tt .wantErr != nil {
179201 if err == nil {
You can’t perform that action at this time.
0 commit comments