@@ -73,8 +73,8 @@ func init() {
73
73
AssertCountByCond (t , "follow" , builder.Eq {"user_id" : user .int ("ID" )}, user .int ("NumFollowing" ))
74
74
AssertCountByCond (t , "follow" , builder.Eq {"follow_id" : user .int ("ID" )}, user .int ("NumFollowers" ))
75
75
if user .int ("Type" ) != modelsUserTypeOrganization {
76
- assert .EqualValues (t , 0 , user .int ("NumMembers" ))
77
- assert .EqualValues (t , 0 , user .int ("NumTeams" ))
76
+ assert .EqualValues (t , 0 , user .int ("NumMembers" ), "Unexpected number of members for user id: %d" , user . int ( "ID" ) )
77
+ assert .EqualValues (t , 0 , user .int ("NumTeams" ), "Unexpected number of teams for user id: %d" , user . int ( "ID" ) )
78
78
}
79
79
}
80
80
@@ -91,53 +91,53 @@ func init() {
91
91
actual := GetCountByCond (t , "watch" , builder.Eq {"repo_id" : repo .int ("ID" )}.
92
92
And (builder.Neq {"mode" : modelsRepoWatchModeDont }))
93
93
assert .EqualValues (t , repo .int ("NumWatches" ), actual ,
94
- "Unexpected number of watches for repo %+v " , repo )
94
+ "Unexpected number of watches for repo id: %d " , repo . int ( "ID" ) )
95
95
96
96
actual = GetCountByCond (t , "issue" , builder.Eq {"is_pull" : false , "repo_id" : repo .int ("ID" )})
97
97
assert .EqualValues (t , repo .int ("NumIssues" ), actual ,
98
- "Unexpected number of issues for repo %+v " , repo )
98
+ "Unexpected number of issues for repo id: %d " , repo . int ( "ID" ) )
99
99
100
100
actual = GetCountByCond (t , "issue" , builder.Eq {"is_pull" : false , "is_closed" : true , "repo_id" : repo .int ("ID" )})
101
101
assert .EqualValues (t , repo .int ("NumClosedIssues" ), actual ,
102
- "Unexpected number of closed issues for repo %+v " , repo )
102
+ "Unexpected number of closed issues for repo id: %d " , repo . int ( "ID" ) )
103
103
104
104
actual = GetCountByCond (t , "issue" , builder.Eq {"is_pull" : true , "repo_id" : repo .int ("ID" )})
105
105
assert .EqualValues (t , repo .int ("NumPulls" ), actual ,
106
- "Unexpected number of pulls for repo %+v " , repo )
106
+ "Unexpected number of pulls for repo id: %d " , repo . int ( "ID" ) )
107
107
108
108
actual = GetCountByCond (t , "issue" , builder.Eq {"is_pull" : true , "is_closed" : true , "repo_id" : repo .int ("ID" )})
109
109
assert .EqualValues (t , repo .int ("NumClosedPulls" ), actual ,
110
- "Unexpected number of closed pulls for repo %+v " , repo )
110
+ "Unexpected number of closed pulls for repo id: %d " , repo . int ( "ID" ) )
111
111
112
112
actual = GetCountByCond (t , "milestone" , builder.Eq {"is_closed" : true , "repo_id" : repo .int ("ID" )})
113
113
assert .EqualValues (t , repo .int ("NumClosedMilestones" ), actual ,
114
- "Unexpected number of closed milestones for repo %+v " , repo )
114
+ "Unexpected number of closed milestones for repo id: %d " , repo . int ( "ID" ) )
115
115
}
116
116
117
117
checkForIssueConsistency := func (t assert.TestingT , bean interface {}) {
118
118
issue := reflectionWrap (bean )
119
119
typeComment := modelsCommentTypeComment
120
120
actual := GetCountByCond (t , "comment" , builder.Eq {"`type`" : typeComment , "issue_id" : issue .int ("ID" )})
121
- assert .EqualValues (t , issue .int ("NumComments" ), actual , "Unexpected number of comments for issue %+v " , issue )
121
+ assert .EqualValues (t , issue .int ("NumComments" ), actual , "Unexpected number of comments for issue id: %d " , issue . int ( "ID" ) )
122
122
if issue .bool ("IsPull" ) {
123
123
prRow := AssertExistsAndLoadMap (t , "pull_request" , builder.Eq {"issue_id" : issue .int ("ID" )})
124
- assert .EqualValues (t , parseInt (prRow ["index" ]), issue .int ("Index" ))
124
+ assert .EqualValues (t , parseInt (prRow ["index" ]), issue .int ("Index" ), "Unexpected index for issue id: %d" , issue . int ( "ID" ) )
125
125
}
126
126
}
127
127
128
128
checkForPullRequestConsistency := func (t assert.TestingT , bean interface {}) {
129
129
pr := reflectionWrap (bean )
130
130
issueRow := AssertExistsAndLoadMap (t , "issue" , builder.Eq {"id" : pr .int ("IssueID" )})
131
131
assert .True (t , parseBool (issueRow ["is_pull" ]))
132
- assert .EqualValues (t , parseInt (issueRow ["index" ]), pr .int ("Index" ))
132
+ assert .EqualValues (t , parseInt (issueRow ["index" ]), pr .int ("Index" ), "Unexpected index for pull request id: %d" , pr . int ( "ID" ) )
133
133
}
134
134
135
135
checkForMilestoneConsistency := func (t assert.TestingT , bean interface {}) {
136
136
milestone := reflectionWrap (bean )
137
137
AssertCountByCond (t , "issue" , builder.Eq {"milestone_id" : milestone .int ("ID" )}, milestone .int ("NumIssues" ))
138
138
139
139
actual := GetCountByCond (t , "issue" , builder.Eq {"is_closed" : true , "milestone_id" : milestone .int ("ID" )})
140
- assert .EqualValues (t , milestone .int ("NumClosedIssues" ), actual , "Unexpected number of closed issues for milestone %+v " , milestone )
140
+ assert .EqualValues (t , milestone .int ("NumClosedIssues" ), actual , "Unexpected number of closed issues for milestone id: %d " , milestone . int ( "ID" ) )
141
141
142
142
completeness := 0
143
143
if milestone .int ("NumIssues" ) > 0 {
@@ -153,7 +153,7 @@ func init() {
153
153
Query ()
154
154
assert .NoError (t , err )
155
155
156
- assert .EqualValues (t , label .int ("NumIssues" ), len (issueLabels ), "Unexpected number of issue for label %+v " , label )
156
+ assert .EqualValues (t , label .int ("NumIssues" ), len (issueLabels ), "Unexpected number of issue for label id: %d " , label . int ( "ID" ) )
157
157
158
158
issueIDs := make ([]int , len (issueLabels ))
159
159
for i , issueLabel := range issueLabels {
@@ -164,7 +164,7 @@ func init() {
164
164
if len (issueIDs ) > 0 {
165
165
expected = GetCountByCond (t , "issue" , builder .In ("id" , issueIDs ).And (builder.Eq {"is_closed" : true }))
166
166
}
167
- assert .EqualValues (t , expected , label .int ("NumClosedIssues" ), "Unexpected number of closed issues for label %+v " , label )
167
+ assert .EqualValues (t , expected , label .int ("NumClosedIssues" ), "Unexpected number of closed issues for label id: %d " , label . int ( "ID" ) )
168
168
}
169
169
170
170
checkForTeamConsistency := func (t assert.TestingT , bean interface {}) {
@@ -177,7 +177,7 @@ func init() {
177
177
action := reflectionWrap (bean )
178
178
if action .int ("RepoID" ) != 1700 { // dangling intentional
179
179
repoRow := AssertExistsAndLoadMap (t , "repository" , builder.Eq {"id" : action .int ("RepoID" )})
180
- assert .Equal (t , parseBool (repoRow ["is_private" ]), action .bool ("IsPrivate" ), "action: %+v " , action )
180
+ assert .Equal (t , parseBool (repoRow ["is_private" ]), action .bool ("IsPrivate" ), "Unexpected is_private field for action id : %d " , action . int ( "ID" ) )
181
181
}
182
182
}
183
183
0 commit comments