@@ -260,7 +260,7 @@ func tester() (t testing.TB) {
260
260
261
261
// NotImplemented always panics with 'not implemented' assertion message.
262
262
func NotImplemented (a ... any ) {
263
- Default ().reportAssertionFault ("not implemented" , a ... )
263
+ Default ().reportAssertionFault ("not implemented" , a )
264
264
}
265
265
266
266
// ThatNot asserts that the term is NOT true. If is it panics with the given
@@ -269,7 +269,7 @@ func NotImplemented(a ...any) {
269
269
func ThatNot (term bool , a ... any ) {
270
270
if term {
271
271
defMsg := "ThatNot: " + assertionMsg
272
- Default ().reportAssertionFault (defMsg , a ... )
272
+ Default ().reportAssertionFault (defMsg , a )
273
273
}
274
274
}
275
275
@@ -279,7 +279,7 @@ func ThatNot(term bool, a ...any) {
279
279
func That (term bool , a ... any ) {
280
280
if ! term {
281
281
defMsg := "That: " + assertionMsg
282
- Default ().reportAssertionFault (defMsg , a ... )
282
+ Default ().reportAssertionFault (defMsg , a )
283
283
}
284
284
}
285
285
@@ -288,7 +288,7 @@ func That(term bool, a ...any) {
288
288
func NotNil [P ~ * T , T any ](p P , a ... any ) {
289
289
if p == nil {
290
290
defMsg := assertionMsg + ": pointer shouldn't be nil"
291
- Default ().reportAssertionFault (defMsg , a ... )
291
+ Default ().reportAssertionFault (defMsg , a )
292
292
}
293
293
}
294
294
@@ -297,7 +297,7 @@ func NotNil[P ~*T, T any](p P, a ...any) {
297
297
func Nil [T any ](p * T , a ... any ) {
298
298
if p != nil {
299
299
defMsg := assertionMsg + ": pointer should be nil"
300
- Default ().reportAssertionFault (defMsg , a ... )
300
+ Default ().reportAssertionFault (defMsg , a )
301
301
}
302
302
}
303
303
@@ -311,7 +311,7 @@ func Nil[T any](p *T, a ...any) {
311
311
func INil (i any , a ... any ) {
312
312
if i != nil {
313
313
defMsg := assertionMsg + ": interface should be nil"
314
- Default ().reportAssertionFault (defMsg , a ... )
314
+ Default ().reportAssertionFault (defMsg , a )
315
315
}
316
316
}
317
317
@@ -325,7 +325,7 @@ func INil(i any, a ...any) {
325
325
func INotNil (i any , a ... any ) {
326
326
if i == nil {
327
327
defMsg := assertionMsg + ": interface shouldn't be nil"
328
- Default ().reportAssertionFault (defMsg , a ... )
328
+ Default ().reportAssertionFault (defMsg , a )
329
329
}
330
330
}
331
331
@@ -334,7 +334,7 @@ func INotNil(i any, a ...any) {
334
334
func SNil [S ~ []T , T any ](s S , a ... any ) {
335
335
if s != nil {
336
336
defMsg := assertionMsg + ": slice should be nil"
337
- Default ().reportAssertionFault (defMsg , a ... )
337
+ Default ().reportAssertionFault (defMsg , a )
338
338
}
339
339
}
340
340
@@ -343,7 +343,7 @@ func SNil[S ~[]T, T any](s S, a ...any) {
343
343
func SNotNil [S ~ []T , T any ](s S , a ... any ) {
344
344
if s == nil {
345
345
defMsg := assertionMsg + ": slice shouldn't be nil"
346
- Default ().reportAssertionFault (defMsg , a ... )
346
+ Default ().reportAssertionFault (defMsg , a )
347
347
}
348
348
}
349
349
@@ -352,7 +352,7 @@ func SNotNil[S ~[]T, T any](s S, a ...any) {
352
352
func CNotNil [C ~ chan T , T any ](c C , a ... any ) {
353
353
if c == nil {
354
354
defMsg := assertionMsg + ": channel shouldn't be nil"
355
- Default ().reportAssertionFault (defMsg , a ... )
355
+ Default ().reportAssertionFault (defMsg , a )
356
356
}
357
357
}
358
358
@@ -361,7 +361,7 @@ func CNotNil[C ~chan T, T any](c C, a ...any) {
361
361
func MNotNil [M ~ map [T ]U , T comparable , U any ](m M , a ... any ) {
362
362
if m == nil {
363
363
defMsg := assertionMsg + ": map shouldn't be nil"
364
- Default ().reportAssertionFault (defMsg , a ... )
364
+ Default ().reportAssertionFault (defMsg , a )
365
365
}
366
366
}
367
367
@@ -371,7 +371,7 @@ func MNotNil[M ~map[T]U, T comparable, U any](m M, a ...any) {
371
371
func NotEqual [T comparable ](val , want T , a ... any ) {
372
372
if want == val {
373
373
defMsg := fmt .Sprintf (assertionMsg + ": got '%v' want (!= '%v')" , val , want )
374
- Default ().reportAssertionFault (defMsg , a ... )
374
+ Default ().reportAssertionFault (defMsg , a )
375
375
}
376
376
}
377
377
@@ -381,7 +381,7 @@ func NotEqual[T comparable](val, want T, a ...any) {
381
381
func Equal [T comparable ](val , want T , a ... any ) {
382
382
if want != val {
383
383
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , val , want )
384
- Default ().reportAssertionFault (defMsg , a ... )
384
+ Default ().reportAssertionFault (defMsg , a )
385
385
}
386
386
}
387
387
@@ -392,7 +392,7 @@ func Equal[T comparable](val, want T, a ...any) {
392
392
func DeepEqual (val , want any , a ... any ) {
393
393
if ! reflect .DeepEqual (val , want ) {
394
394
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , val , want )
395
- Default ().reportAssertionFault (defMsg , a ... )
395
+ Default ().reportAssertionFault (defMsg , a )
396
396
}
397
397
}
398
398
@@ -408,7 +408,7 @@ func DeepEqual(val, want any, a ...any) {
408
408
func NotDeepEqual (val , want any , a ... any ) {
409
409
if reflect .DeepEqual (val , want ) {
410
410
defMsg := fmt .Sprintf (assertionMsg + ": got '%v', want (!= '%v')" , val , want )
411
- Default ().reportAssertionFault (defMsg , a ... )
411
+ Default ().reportAssertionFault (defMsg , a )
412
412
}
413
413
}
414
414
@@ -424,7 +424,7 @@ func Len(obj string, length int, a ...any) {
424
424
425
425
if l != length {
426
426
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , l , length )
427
- Default ().reportAssertionFault (defMsg , a ... )
427
+ Default ().reportAssertionFault (defMsg , a )
428
428
}
429
429
}
430
430
@@ -440,7 +440,7 @@ func Longer(obj string, length int, a ...any) {
440
440
441
441
if l > length {
442
442
defMsg := fmt .Sprintf (assertionMsg + gotWantLongerFmt , l , length )
443
- Default ().reportAssertionFault (defMsg , a ... )
443
+ Default ().reportAssertionFault (defMsg , a )
444
444
}
445
445
}
446
446
@@ -456,7 +456,7 @@ func Shorter(obj string, length int, a ...any) {
456
456
457
457
if l <= length {
458
458
defMsg := fmt .Sprintf (assertionMsg + gotWantShorterFmt , l , length )
459
- Default ().reportAssertionFault (defMsg , a ... )
459
+ Default ().reportAssertionFault (defMsg , a )
460
460
}
461
461
}
462
462
@@ -472,7 +472,7 @@ func SLen[S ~[]T, T any](obj S, length int, a ...any) {
472
472
473
473
if l != length {
474
474
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , l , length )
475
- Default ().reportAssertionFault (defMsg , a ... )
475
+ Default ().reportAssertionFault (defMsg , a )
476
476
}
477
477
}
478
478
@@ -488,7 +488,7 @@ func SLonger[S ~[]T, T any](obj S, length int, a ...any) {
488
488
489
489
if l <= length {
490
490
defMsg := fmt .Sprintf (assertionMsg + gotWantLongerFmt , l , length )
491
- Default ().reportAssertionFault (defMsg , a ... )
491
+ Default ().reportAssertionFault (defMsg , a )
492
492
}
493
493
}
494
494
@@ -504,7 +504,7 @@ func SShorter[S ~[]T, T any](obj S, length int, a ...any) {
504
504
505
505
if l >= length {
506
506
defMsg := fmt .Sprintf (assertionMsg + gotWantShorterFmt , l , length )
507
- Default ().reportAssertionFault (defMsg , a ... )
507
+ Default ().reportAssertionFault (defMsg , a )
508
508
}
509
509
}
510
510
@@ -520,7 +520,7 @@ func MLen[M ~map[T]U, T comparable, U any](obj M, length int, a ...any) {
520
520
521
521
if l != length {
522
522
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , l , length )
523
- Default ().reportAssertionFault (defMsg , a ... )
523
+ Default ().reportAssertionFault (defMsg , a )
524
524
}
525
525
}
526
526
@@ -536,7 +536,7 @@ func MLonger[M ~map[T]U, T comparable, U any](obj M, length int, a ...any) {
536
536
537
537
if l <= length {
538
538
defMsg := fmt .Sprintf (assertionMsg + gotWantLongerFmt , l , length )
539
- Default ().reportAssertionFault (defMsg , a ... )
539
+ Default ().reportAssertionFault (defMsg , a )
540
540
}
541
541
}
542
542
@@ -552,7 +552,7 @@ func MShorter[M ~map[T]U, T comparable, U any](obj M, length int, a ...any) {
552
552
553
553
if l >= length {
554
554
defMsg := fmt .Sprintf (assertionMsg + gotWantShorterFmt , l , length )
555
- Default ().reportAssertionFault (defMsg , a ... )
555
+ Default ().reportAssertionFault (defMsg , a )
556
556
}
557
557
}
558
558
@@ -568,7 +568,7 @@ func CLen[C ~chan T, T any](obj C, length int, a ...any) {
568
568
569
569
if l != length {
570
570
defMsg := fmt .Sprintf (assertionMsg + gotWantFmt , l , length )
571
- Default ().reportAssertionFault (defMsg , a ... )
571
+ Default ().reportAssertionFault (defMsg , a )
572
572
}
573
573
}
574
574
@@ -584,7 +584,7 @@ func CLonger[C ~chan T, T any](obj C, length int, a ...any) {
584
584
585
585
if l <= length {
586
586
defMsg := fmt .Sprintf (assertionMsg + gotWantLongerFmt , l , length )
587
- Default ().reportAssertionFault (defMsg , a ... )
587
+ Default ().reportAssertionFault (defMsg , a )
588
588
}
589
589
}
590
590
@@ -600,7 +600,7 @@ func CShorter[C ~chan T, T any](obj C, length int, a ...any) {
600
600
601
601
if l >= length {
602
602
defMsg := fmt .Sprintf (assertionMsg + gotWantShorterFmt , l , length )
603
- Default ().reportAssertionFault (defMsg , a ... )
603
+ Default ().reportAssertionFault (defMsg , a )
604
604
}
605
605
}
606
606
@@ -612,7 +612,7 @@ func MKeyExists[M ~map[T]U, T comparable, U any](obj M, key T, a ...any) (val U)
612
612
613
613
if ! ok {
614
614
defMsg := fmt .Sprintf (assertionMsg + ": key '%v' doesn't exist" , key )
615
- Default ().reportAssertionFault (defMsg , a ... )
615
+ Default ().reportAssertionFault (defMsg , a )
616
616
}
617
617
return val
618
618
}
@@ -623,7 +623,7 @@ func MKeyExists[M ~map[T]U, T comparable, U any](obj M, key T, a ...any) (val U)
623
623
func NotEmpty (obj string , a ... any ) {
624
624
if obj == "" {
625
625
defMsg := assertionMsg + ": string shouldn't be empty"
626
- Default ().reportAssertionFault (defMsg , a ... )
626
+ Default ().reportAssertionFault (defMsg , a )
627
627
}
628
628
}
629
629
@@ -633,7 +633,7 @@ func NotEmpty(obj string, a ...any) {
633
633
func Empty (obj string , a ... any ) {
634
634
if obj != "" {
635
635
defMsg := assertionMsg + ": string should be empty"
636
- Default ().reportAssertionFault (defMsg , a ... )
636
+ Default ().reportAssertionFault (defMsg , a )
637
637
}
638
638
}
639
639
@@ -648,7 +648,7 @@ func SNotEmpty[S ~[]T, T any](obj S, a ...any) {
648
648
649
649
if l == 0 {
650
650
defMsg := assertionMsg + ": slice shouldn't be empty"
651
- Default ().reportAssertionFault (defMsg , a ... )
651
+ Default ().reportAssertionFault (defMsg , a )
652
652
}
653
653
}
654
654
@@ -665,7 +665,7 @@ func MNotEmpty[M ~map[T]U, T comparable, U any](obj M, a ...any) {
665
665
666
666
if l == 0 {
667
667
defMsg := assertionMsg + ": map shouldn't be empty"
668
- Default ().reportAssertionFault (defMsg , a ... )
668
+ Default ().reportAssertionFault (defMsg , a )
669
669
}
670
670
}
671
671
@@ -681,7 +681,7 @@ func MNotEmpty[M ~map[T]U, T comparable, U any](obj M, a ...any) {
681
681
func NoError (err error , a ... any ) {
682
682
if err != nil {
683
683
defMsg := "NoError:" + assertionMsg + conCatErrStr + err .Error ()
684
- Default ().reportAssertionFault (defMsg , a ... )
684
+ Default ().reportAssertionFault (defMsg , a )
685
685
}
686
686
}
687
687
@@ -691,7 +691,7 @@ func NoError(err error, a ...any) {
691
691
func Error (err error , a ... any ) {
692
692
if err == nil {
693
693
defMsg := "Error:" + assertionMsg + ": missing error"
694
- Default ().reportAssertionFault (defMsg , a ... )
694
+ Default ().reportAssertionFault (defMsg , a )
695
695
}
696
696
}
697
697
@@ -701,7 +701,7 @@ func Error(err error, a ...any) {
701
701
func Zero [T Number ](val T , a ... any ) {
702
702
if val != 0 {
703
703
defMsg := fmt .Sprintf (assertionMsg + ": got '%v', want (== '0')" , val )
704
- Default ().reportAssertionFault (defMsg , a ... )
704
+ Default ().reportAssertionFault (defMsg , a )
705
705
}
706
706
}
707
707
@@ -711,7 +711,7 @@ func Zero[T Number](val T, a ...any) {
711
711
func NotZero [T Number ](val T , a ... any ) {
712
712
if val == 0 {
713
713
defMsg := fmt .Sprintf (assertionMsg + ": got '%v', want (!= 0)" , val )
714
- Default ().reportAssertionFault (defMsg , a ... )
714
+ Default ().reportAssertionFault (defMsg , a )
715
715
}
716
716
}
717
717
@@ -793,7 +793,7 @@ func newDefInd(v string) defInd {
793
793
func combineArgs (format string , a []any ) []any {
794
794
args := make ([]any , 1 , len (a )+ 1 )
795
795
args [0 ] = format
796
- args = append (args , a ... )
796
+ args = append (args , a )
797
797
return args
798
798
}
799
799
0 commit comments