|
|
@ -155,6 +155,25 @@ func TestPushCommits_AvatarLink(t *testing.T) {
|
|
|
|
pushCommits.AvatarLink("nonexistent@example.com"))
|
|
|
|
pushCommits.AvatarLink("nonexistent@example.com"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestRegExp_issueReferenceKeywordsPat(t *testing.T) {
|
|
|
|
|
|
|
|
trueTestCases := []string{
|
|
|
|
|
|
|
|
"#2",
|
|
|
|
|
|
|
|
"[#2]",
|
|
|
|
|
|
|
|
"please see go-gitea/gitea#5",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
falseTestCases := []string{
|
|
|
|
|
|
|
|
"kb#2",
|
|
|
|
|
|
|
|
"#2xy",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, testCase := range trueTestCases {
|
|
|
|
|
|
|
|
assert.True(t, issueReferenceKeywordsPat.MatchString(testCase))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, testCase := range falseTestCases {
|
|
|
|
|
|
|
|
assert.False(t, issueReferenceKeywordsPat.MatchString(testCase))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func Test_getIssueFromRef(t *testing.T) {
|
|
|
|
func Test_getIssueFromRef(t *testing.T) {
|
|
|
|
assert.NoError(t, PrepareTestDatabase())
|
|
|
|
assert.NoError(t, PrepareTestDatabase())
|
|
|
|
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
|
|
|
|
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
|
|
|
|