Skip to content

Commit 7113f15

Browse files
committed
Fix functions name
1 parent 478f6ad commit 7113f15

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

models/consistency.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ func CheckConsistencyFor(t *testing.T, beansToCheck ...interface{}) {
5050
func checkForConsistency(bean interface{}, t *testing.T) {
5151
switch b := bean.(type) {
5252
case *User:
53-
checkForConsistencyUser(b, t)
53+
checkForUserConsistency(b, t)
5454
case *Repository:
55-
checkForConsistencyRepo(b, t)
55+
checkForRepoConsistency(b, t)
5656
case *Issue:
57-
checkForConsistencyIssue(b, t)
57+
checkForIssueConsistency(b, t)
5858
case *PullRequest:
59-
checkForConsistencyPullRequest(b, t)
59+
checkForPullRequestConsistency(b, t)
6060
case *Milestone:
61-
checkForConsistencyMilestone(b, t)
61+
checkForMilestoneConsistency(b, t)
6262
case *Label:
63-
checkForConsistencyLabel(b, t)
63+
checkForLabelConsistency(b, t)
6464
case *Team:
65-
checkForConsistencyTeam(b, t)
65+
checkForTeamConsistency(b, t)
6666
case *Action:
67-
checkForConsistencyAction(b, t)
67+
checkForActionConsistency(b, t)
6868
default:
6969
t.Errorf("unknow bean type: %#v", bean)
7070
}
@@ -83,7 +83,7 @@ func assertCount(t *testing.T, bean interface{}, expected int) {
8383
"Failed consistency test, the counted bean (of type %T) was %+v", bean, bean)
8484
}
8585

86-
func checkForConsistencyUser(user *User, t *testing.T) {
86+
func checkForUserConsistency(user *User, t *testing.T) {
8787
assertCount(t, &Repository{OwnerID: user.ID}, user.NumRepos)
8888
assertCount(t, &Star{UID: user.ID}, user.NumStars)
8989
assertCount(t, &OrgUser{OrgID: user.ID}, user.NumMembers)
@@ -96,7 +96,7 @@ func checkForConsistencyUser(user *User, t *testing.T) {
9696
}
9797
}
9898

99-
func checkForConsistencyRepo(repo *Repository, t *testing.T) {
99+
func checkForRepoConsistency(repo *Repository, t *testing.T) {
100100
assert.Equal(t, repo.LowerName, strings.ToLower(repo.Name), "repo: %+v", repo)
101101
assertCount(t, &Star{RepoID: repo.ID}, repo.NumStars)
102102
assertCount(t, &Milestone{RepoID: repo.ID}, repo.NumMilestones)
@@ -130,7 +130,7 @@ func checkForConsistencyRepo(repo *Repository, t *testing.T) {
130130
"Unexpected number of closed milestones for repo %+v", repo)
131131
}
132132

133-
func checkForConsistencyIssue(issue *Issue, t *testing.T) {
133+
func checkForIssueConsistency(issue *Issue, t *testing.T) {
134134
actual := getCount(t, db.GetEngine(db.DefaultContext).Where("type=?", CommentTypeComment), &Comment{IssueID: issue.ID})
135135
assert.EqualValues(t, issue.NumComments, actual,
136136
"Unexpected number of comments for issue %+v", issue)
@@ -140,13 +140,13 @@ func checkForConsistencyIssue(issue *Issue, t *testing.T) {
140140
}
141141
}
142142

143-
func checkForConsistencyPullRequest(pr *PullRequest, t *testing.T) {
143+
func checkForPullRequestConsistency(pr *PullRequest, t *testing.T) {
144144
issue := db.AssertExistsAndLoadBean(t, &Issue{ID: pr.IssueID}).(*Issue)
145145
assert.True(t, issue.IsPull)
146146
assert.EqualValues(t, issue.Index, pr.Index)
147147
}
148148

149-
func checkForConsistencyMilestone(milestone *Milestone, t *testing.T) {
149+
func checkForMilestoneConsistency(milestone *Milestone, t *testing.T) {
150150
assertCount(t, &Issue{MilestoneID: milestone.ID}, milestone.NumIssues)
151151

152152
actual := getCount(t, db.GetEngine(db.DefaultContext).Where("is_closed=?", true), &Issue{MilestoneID: milestone.ID})
@@ -160,7 +160,7 @@ func checkForConsistencyMilestone(milestone *Milestone, t *testing.T) {
160160
assert.Equal(t, completeness, milestone.Completeness)
161161
}
162162

163-
func checkForConsistencyLabel(label *Label, t *testing.T) {
163+
func checkForLabelConsistency(label *Label, t *testing.T) {
164164
issueLabels := make([]*IssueLabel, 0, 10)
165165
assert.NoError(t, db.GetEngine(db.DefaultContext).Find(&issueLabels, &IssueLabel{LabelID: label.ID}))
166166
assert.EqualValues(t, label.NumIssues, len(issueLabels),
@@ -179,12 +179,12 @@ func checkForConsistencyLabel(label *Label, t *testing.T) {
179179
"Unexpected number of closed issues for label %+v", label)
180180
}
181181

182-
func checkForConsistencyTeam(team *Team, t *testing.T) {
182+
func checkForTeamConsistency(team *Team, t *testing.T) {
183183
assertCount(t, &TeamUser{TeamID: team.ID}, team.NumMembers)
184184
assertCount(t, &TeamRepo{TeamID: team.ID}, team.NumRepos)
185185
}
186186

187-
func checkForConsistencyAction(action *Action, t *testing.T) {
187+
func checkForActionConsistency(action *Action, t *testing.T) {
188188
repo := db.AssertExistsAndLoadBean(t, &Repository{ID: action.RepoID}).(*Repository)
189189
assert.Equal(t, repo.IsPrivate, action.IsPrivate, "action: %+v", action)
190190
}

0 commit comments

Comments
 (0)