1
2
3
4
5
6
7 package assert
8
9 import (
10 time "time"
11 )
12
13
14
15
16
17
18
19 func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool {
20 if h, ok := t.(tHelper); ok {
21 h.Helper()
22 }
23 return Contains(t, s, contains, append([]interface{}{msg}, args...)...)
24 }
25
26
27
28
29
30
31 func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) bool {
32 if h, ok := t.(tHelper); ok {
33 h.Helper()
34 }
35 return ElementsMatch(t, listA, listB, append([]interface{}{msg}, args...)...)
36 }
37
38
39
40
41
42
43
44
45 func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
46 if h, ok := t.(tHelper); ok {
47 h.Helper()
48 }
49 return Equal(t, expected, actual, append([]interface{}{msg}, args...)...)
50 }
51
52
53
54
55
56
57 func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool {
58 if h, ok := t.(tHelper); ok {
59 h.Helper()
60 }
61 return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...)
62 }
63
64
65
66
67
68 func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
69 if h, ok := t.(tHelper); ok {
70 h.Helper()
71 }
72 return EqualValues(t, expected, actual, append([]interface{}{msg}, args...)...)
73 }
74
75
76
77
78
79
80
81 func Errorf(t TestingT, err error, msg string, args ...interface{}) bool {
82 if h, ok := t.(tHelper); ok {
83 h.Helper()
84 }
85 return Error(t, err, append([]interface{}{msg}, args...)...)
86 }
87
88
89
90
91
92
93 func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool {
94 if h, ok := t.(tHelper); ok {
95 h.Helper()
96 }
97 return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...)
98 }
99
100
101
102
103
104 func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
105 if h, ok := t.(tHelper); ok {
106 h.Helper()
107 }
108 return Eventually(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...)
109 }
110
111
112 func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) bool {
113 if h, ok := t.(tHelper); ok {
114 h.Helper()
115 }
116 return Fail(t, failureMessage, append([]interface{}{msg}, args...)...)
117 }
118
119
120 func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}) bool {
121 if h, ok := t.(tHelper); ok {
122 h.Helper()
123 }
124 return FailNow(t, failureMessage, append([]interface{}{msg}, args...)...)
125 }
126
127
128
129
130 func Falsef(t TestingT, value bool, msg string, args ...interface{}) bool {
131 if h, ok := t.(tHelper); ok {
132 h.Helper()
133 }
134 return False(t, value, append([]interface{}{msg}, args...)...)
135 }
136
137
138
139
140
141
142 func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
143 if h, ok := t.(tHelper); ok {
144 h.Helper()
145 }
146 return Greater(t, e1, e2, append([]interface{}{msg}, args...)...)
147 }
148
149
150
151
152
153
154
155 func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
156 if h, ok := t.(tHelper); ok {
157 h.Helper()
158 }
159 return GreaterOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...)
160 }
161
162
163
164
165 func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
166 if h, ok := t.(tHelper); ok {
167 h.Helper()
168 }
169 return InDelta(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
170 }
171
172
173 func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool {
174 if h, ok := t.(tHelper); ok {
175 h.Helper()
176 }
177 return IsType(t, expectedType, object, append([]interface{}{msg}, args...)...)
178 }
179
180
181
182
183
184 func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) bool {
185 if h, ok := t.(tHelper); ok {
186 h.Helper()
187 }
188 return Len(t, object, length, append([]interface{}{msg}, args...)...)
189 }
190
191
192
193
194
195
196 func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
197 if h, ok := t.(tHelper); ok {
198 h.Helper()
199 }
200 return Less(t, e1, e2, append([]interface{}{msg}, args...)...)
201 }
202
203
204
205
206
207
208
209 func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
210 if h, ok := t.(tHelper); ok {
211 h.Helper()
212 }
213 return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...)
214 }
215
216
217
218
219
220 func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
221 if h, ok := t.(tHelper); ok {
222 h.Helper()
223 }
224 return Negative(t, e, append([]interface{}{msg}, args...)...)
225 }
226
227
228
229
230 func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
231 if h, ok := t.(tHelper); ok {
232 h.Helper()
233 }
234 return Nil(t, object, append([]interface{}{msg}, args...)...)
235 }
236
237
238
239
240
241
242
243 func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool {
244 if h, ok := t.(tHelper); ok {
245 h.Helper()
246 }
247 return NoError(t, err, append([]interface{}{msg}, args...)...)
248 }
249
250
251
252
253
254
255
256 func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool {
257 if h, ok := t.(tHelper); ok {
258 h.Helper()
259 }
260 return NotContains(t, s, contains, append([]interface{}{msg}, args...)...)
261 }
262
263
264
265
266
267
268
269 func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
270 if h, ok := t.(tHelper); ok {
271 h.Helper()
272 }
273 return NotEqual(t, expected, actual, append([]interface{}{msg}, args...)...)
274 }
275
276
277
278
279 func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
280 if h, ok := t.(tHelper); ok {
281 h.Helper()
282 }
283 return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...)
284 }
285
286
287
288
289 func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
290 if h, ok := t.(tHelper); ok {
291 h.Helper()
292 }
293 return NotNil(t, object, append([]interface{}{msg}, args...)...)
294 }
295
296
297
298
299
300 func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
301 if h, ok := t.(tHelper); ok {
302 h.Helper()
303 }
304 return Positive(t, e, append([]interface{}{msg}, args...)...)
305 }
306
307
308
309
310 func Truef(t TestingT, value bool, msg string, args ...interface{}) bool {
311 if h, ok := t.(tHelper); ok {
312 h.Helper()
313 }
314 return True(t, value, append([]interface{}{msg}, args...)...)
315 }
316
317
318
319
320 func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
321 if h, ok := t.(tHelper); ok {
322 h.Helper()
323 }
324 return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
325 }
326
View as plain text