@@ -158,6 +158,8 @@ func Test_normalizeURL(t *testing.T) {
158
158
{".git suffix" , "https://github.com/foo/bar.git" , "https://github.com/foo/bar.git" },
159
159
{"http://" , "http://github.com/foo/bar" , "https://github.com/foo/bar.git" },
160
160
{"git://" , "git://github.com/foo/bar" , "https://github.com/foo/bar.git" },
161
+ {"Root URL" , "https://github.com" , "https://github.com/" },
162
+ {"Root URL with trailing slash" , "https://github.com/" , "https://github.com/" },
161
163
}
162
164
163
165
for _ , testTable := range testTables {
@@ -196,6 +198,8 @@ func Test_uRLIsUnder(t *testing.T) {
196
198
{"Mismatch, root path" , "https://github.com/foo/bar" , []string {"example.com" , "example.org" }, assert .False },
197
199
{"Match, subfolder" , "https://github.com/foo/bar" , []string {"example.com/foo" , "github.com/foo" }, assert .True },
198
200
{"Mismatch, subfolder" , "https://github.com/foo/bar" , []string {"example.com/foo" , "github.org/bar" }, assert .False },
201
+ {"Match, root child URL" , "https://github.com/" , []string {"example.com" , "github.com" }, assert .True },
202
+ {"Mismatch, root child URL" , "https://github.com/" , []string {"example.com" , "github.org" }, assert .False },
199
203
}
200
204
201
205
for _ , testTable := range testTables {
0 commit comments