@@ -29,8 +29,8 @@ func TestCompare(t *testing.T) {
29
29
type customTime time.Time
30
30
type customBytes []byte
31
31
for _ , currCase := range []struct {
32
- less interface {}
33
- greater interface {}
32
+ less any
33
+ greater any
34
34
cType string
35
35
}{
36
36
{less : customString ("a" ), greater : customString ("b" ), cType : "string" },
@@ -102,7 +102,7 @@ type outputT struct {
102
102
}
103
103
104
104
// Implements TestingT
105
- func (t * outputT ) Errorf (format string , args ... interface {} ) {
105
+ func (t * outputT ) Errorf (format string , args ... any ) {
106
106
s := fmt .Sprintf (format , args ... )
107
107
t .buf .WriteString (s )
108
108
}
@@ -147,8 +147,8 @@ func TestGreater(t *testing.T) {
147
147
148
148
// Check error report
149
149
for _ , currCase := range []struct {
150
- less interface {}
151
- greater interface {}
150
+ less any
151
+ greater any
152
152
msg string
153
153
}{
154
154
{less : "a" , greater : "b" , msg : `"a" is not greater than "b"` },
@@ -170,7 +170,7 @@ func TestGreater(t *testing.T) {
170
170
out := & outputT {buf : bytes .NewBuffer (nil )}
171
171
False (t , Greater (out , currCase .less , currCase .greater ))
172
172
Contains (t , out .buf .String (), currCase .msg )
173
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.Greater" )
173
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.Greater" )
174
174
}
175
175
}
176
176
@@ -193,8 +193,8 @@ func TestGreaterOrEqual(t *testing.T) {
193
193
194
194
// Check error report
195
195
for _ , currCase := range []struct {
196
- less interface {}
197
- greater interface {}
196
+ less any
197
+ greater any
198
198
msg string
199
199
}{
200
200
{less : "a" , greater : "b" , msg : `"a" is not greater than or equal to "b"` },
@@ -216,7 +216,7 @@ func TestGreaterOrEqual(t *testing.T) {
216
216
out := & outputT {buf : bytes .NewBuffer (nil )}
217
217
False (t , GreaterOrEqual (out , currCase .less , currCase .greater ))
218
218
Contains (t , out .buf .String (), currCase .msg )
219
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.GreaterOrEqual" )
219
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.GreaterOrEqual" )
220
220
}
221
221
}
222
222
@@ -239,8 +239,8 @@ func TestLess(t *testing.T) {
239
239
240
240
// Check error report
241
241
for _ , currCase := range []struct {
242
- less interface {}
243
- greater interface {}
242
+ less any
243
+ greater any
244
244
msg string
245
245
}{
246
246
{less : "a" , greater : "b" , msg : `"b" is not less than "a"` },
@@ -262,7 +262,7 @@ func TestLess(t *testing.T) {
262
262
out := & outputT {buf : bytes .NewBuffer (nil )}
263
263
False (t , Less (out , currCase .greater , currCase .less ))
264
264
Contains (t , out .buf .String (), currCase .msg )
265
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.Less" )
265
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.Less" )
266
266
}
267
267
}
268
268
@@ -285,8 +285,8 @@ func TestLessOrEqual(t *testing.T) {
285
285
286
286
// Check error report
287
287
for _ , currCase := range []struct {
288
- less interface {}
289
- greater interface {}
288
+ less any
289
+ greater any
290
290
msg string
291
291
}{
292
292
{less : "a" , greater : "b" , msg : `"b" is not less than or equal to "a"` },
@@ -308,7 +308,7 @@ func TestLessOrEqual(t *testing.T) {
308
308
out := & outputT {buf : bytes .NewBuffer (nil )}
309
309
False (t , LessOrEqual (out , currCase .greater , currCase .less ))
310
310
Contains (t , out .buf .String (), currCase .msg )
311
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.LessOrEqual" )
311
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.LessOrEqual" )
312
312
}
313
313
}
314
314
@@ -335,7 +335,7 @@ func TestPositive(t *testing.T) {
335
335
336
336
// Check error report
337
337
for _ , currCase := range []struct {
338
- e interface {}
338
+ e any
339
339
msg string
340
340
}{
341
341
{e : int (- 1 ), msg : `"-1" is not positive` },
@@ -349,7 +349,7 @@ func TestPositive(t *testing.T) {
349
349
out := & outputT {buf : bytes .NewBuffer (nil )}
350
350
False (t , Positive (out , currCase .e ))
351
351
Contains (t , out .buf .String (), currCase .msg )
352
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.Positive" )
352
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.Positive" )
353
353
}
354
354
}
355
355
@@ -376,7 +376,7 @@ func TestNegative(t *testing.T) {
376
376
377
377
// Check error report
378
378
for _ , currCase := range []struct {
379
- e interface {}
379
+ e any
7D46
380
380
msg string
381
381
}{
382
382
{e : int (1 ), msg : `"1" is not negative` },
@@ -390,7 +390,7 @@ func TestNegative(t *testing.T) {
390
390
out := & outputT {buf : bytes .NewBuffer (nil )}
391
391
False (t , Negative (out , currCase .e ))
392
392
Contains (t , out .buf .String (), currCase .msg )
393
- Contains (t , out .helpers , "github.com/go-openapi/testify/assert.Negative" )
393
+ Contains (t , out .helpers , "github.com/go-openapi/testify/v2/ assert.Negative" )
394
394
}
395
395
}
396
396
@@ -400,8 +400,8 @@ func Test_compareTwoValuesDifferentValuesTypes(t *testing.T) {
400
400
mockT := new (testing.T )
401
401
402
402
for _ , currCase := range []struct {
403
- v1 interface {}
404
- v2 interface {}
403
+ v1 any
404
+ v2 any
405
405
compareResult bool
406
406
}{
407
407
{v1 : 123 , v2 : "abc" },
@@ -423,8 +423,8 @@ func Test_compareTwoValuesNotComparableValues(t *testing.T) {
423
423
}
424
424
425
425
for _ , currCase := range []struct {
426
- v1 interface {}
427
- v2 interface {}
426
+ v1 any
427
+ v2 any
428
428
}{
429
429
{v1 : CompareStruct {}, v2 : CompareStruct {}},
430
430
{v1 : map [string ]int {}, v2 : map [string ]int {}},
@@ -441,8 +441,8 @@ func Test_compareTwoValuesCorrectCompareResult(t *testing.T) {
441
441
mockT := new (testing.T )
442
442
443
443
for _ , currCase := range []struct {
444
- v1 interface {}
445
- v2 interface {}
444
+ v1 any
445
+ v2 any
446
446
allowedResults []compareResult
447
447
}{
448
448
{v1 : 1 , v2 : 2 , allowedResults : []compareResult {compareLess }},
@@ -476,7 +476,7 @@ func Test_containsValue(t *testing.T) {
476
476
}
477
477
478
478
func TestComparingMsgAndArgsForwarding (t * testing.T ) {
479
- msgAndArgs := []interface {} {"format %s %x" , "this" , 0xc001 }
479
+ msgAndArgs := []any {"format %s %x" , "this" , 0xc001 }
480
480
expectedOutput := "format this c001\n "
481
481
funcs := []func (t TestingT ){
482
482
func (t TestingT ) { Greater (t , 1 , 2 , msgAndArgs ... ) },
0 commit comments