|
|
|
@ -13,12 +13,28 @@ func BenchmarkGetIssueIndexFromHTMLURLAlt(b *testing.B) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestGetIssueIndexFromHTMLURLAlt(t *testing.T) { |
|
|
|
|
res, err := getIssueIndexFromHTMLURLAlt("https://github.com/octocat/Hello-World/issues/1347#issuecomment-1") |
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
assert.Equal(t, 1347, res) |
|
|
|
|
res, err = getIssueIndexFromHTMLURLAlt("https://github.com/oment-1") |
|
|
|
|
assert.Error(t, err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func BenchmarkGetIssueIndexFromHTMLURL(b *testing.B) { |
|
|
|
|
for i := 0; i <= b.N; i++ { |
|
|
|
|
getIssueIndexFromHTMLURL("https://github.com/octocat/Hello-World/issues/1347#issuecomment-1") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestGetIssueIndexFromHTMLURL(t *testing.T) { |
|
|
|
|
res, err := getIssueIndexFromHTMLURL("https://github.com/octocat/Hello-World/issues/1347#issuecomment-1") |
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
assert.Equal(t, 1347, res) |
|
|
|
|
res, err = getIssueIndexFromHTMLURL("https://github.com/oment-1") |
|
|
|
|
assert.Error(t, err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var testFMig = &FetchMigratory{ |
|
|
|
|
Migratory: *DemoMigratory, |
|
|
|
|
GHClient: github.NewClient(nil), |
|
|
|
|