forked from stretchr/testify
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathassert_format.go
More file actions
1294 lines (1161 loc) · 50.1 KB
/
assert_format.go
File metadata and controls
1294 lines (1161 loc) · 50.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
// Code generated with github.com/go-openapi/testify/codegen/v2; DO NOT EDIT.
package assert
import (
"iter"
"net/http"
"net/url"
"reflect"
"time"
"github.com/go-openapi/testify/v2/internal/assertions"
)
// Conditionf is the same as [Condition], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Conditionf(t T, comp func() bool, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Condition(t, comp, forwardArgs(msg, args))
}
// Consistentlyf is the same as [Consistently], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Consistentlyf[C Conditioner](t T, condition C, timeout time.Duration, tick time.Duration, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Consistently[C](t, condition, timeout, tick, forwardArgs(msg, args))
}
// Containsf is the same as [Contains], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Containsf(t T, s any, contains any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Contains(t, s, contains, forwardArgs(msg, args))
}
// DirExistsf is the same as [DirExists], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func DirExistsf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.DirExists(t, path, forwardArgs(msg, args))
}
// DirNotExistsf is the same as [DirNotExists], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func DirNotExistsf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.DirNotExists(t, path, forwardArgs(msg, args))
}
// ElementsMatchf is the same as [ElementsMatch], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ElementsMatchf(t T, listA any, listB any, msg string, args ...any) (ok bool) {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.ElementsMatch(t, listA, listB, forwardArgs(msg, args))
}
// ElementsMatchTf is the same as [ElementsMatchT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ElementsMatchTf[E comparable](t T, listA []E, listB []E, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.ElementsMatchT[E](t, listA, listB, forwardArgs(msg, args))
}
// Emptyf is the same as [Empty], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Emptyf(t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Empty(t, object, forwardArgs(msg, args))
}
// Equalf is the same as [Equal], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Equalf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Equal(t, expected, actual, forwardArgs(msg, args))
}
// EqualErrorf is the same as [EqualError], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualErrorf(t T, err error, errString string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.EqualError(t, err, errString, forwardArgs(msg, args))
}
// EqualExportedValuesf is the same as [EqualExportedValues], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualExportedValuesf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.EqualExportedValues(t, expected, actual, forwardArgs(msg, args))
}
// EqualTf is the same as [EqualT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualTf[V comparable](t T, expected V, actual V, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.EqualT[V](t, expected, actual, forwardArgs(msg, args))
}
// EqualValuesf is the same as [EqualValues], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualValuesf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.EqualValues(t, expected, actual, forwardArgs(msg, args))
}
// Errorf is the same as [Error], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Errorf(t T, err error, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Error(t, err, forwardArgs(msg, args))
}
// ErrorAsf is the same as [ErrorAs], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorAsf(t T, err error, target any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.ErrorAs(t, err, target, forwardArgs(msg, args))
}
// ErrorContainsf is the same as [ErrorContains], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorContainsf(t T, err error, contains string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.ErrorContains(t, err, contains, forwardArgs(msg, args))
}
// ErrorIsf is the same as [ErrorIs], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorIsf(t T, err error, target error, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.ErrorIs(t, err, target, forwardArgs(msg, args))
}
// Eventuallyf is the same as [Eventually], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Eventuallyf[C Conditioner](t T, condition C, timeout time.Duration, tick time.Duration, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Eventually[C](t, condition, timeout, tick, forwardArgs(msg, args))
}
// EventuallyWithf is the same as [EventuallyWith], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EventuallyWithf[C CollectibleConditioner](t T, condition C, timeout time.Duration, tick time.Duration, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.EventuallyWith[C](t, condition, timeout, tick, forwardArgs(msg, args))
}
// Exactlyf is the same as [Exactly], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Exactlyf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Exactly(t, expected, actual, forwardArgs(msg, args))
}
// Failf is the same as [Fail], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Failf(t T, failureMessage string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Fail(t, failureMessage, forwardArgs(msg, args))
}
// FailNowf is the same as [FailNow], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FailNowf(t T, failureMessage string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FailNow(t, failureMessage, forwardArgs(msg, args))
}
// Falsef is the same as [False], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Falsef(t T, value bool, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.False(t, value, forwardArgs(msg, args))
}
// FalseTf is the same as [FalseT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FalseTf[B Boolean](t T, value B, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FalseT[B](t, value, forwardArgs(msg, args))
}
// FileEmptyf is the same as [FileEmpty], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileEmptyf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FileEmpty(t, path, forwardArgs(msg, args))
}
// FileExistsf is the same as [FileExists], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileExistsf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FileExists(t, path, forwardArgs(msg, args))
}
// FileNotEmptyf is the same as [FileNotEmpty], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileNotEmptyf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FileNotEmpty(t, path, forwardArgs(msg, args))
}
// FileNotExistsf is the same as [FileNotExists], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileNotExistsf(t T, path string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.FileNotExists(t, path, forwardArgs(msg, args))
}
// Greaterf is the same as [Greater], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Greaterf(t T, e1 any, e2 any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Greater(t, e1, e2, forwardArgs(msg, args))
}
// GreaterOrEqualf is the same as [GreaterOrEqual], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterOrEqualf(t T, e1 any, e2 any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.GreaterOrEqual(t, e1, e2, forwardArgs(msg, args))
}
// GreaterOrEqualTf is the same as [GreaterOrEqualT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterOrEqualTf[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.GreaterOrEqualT[Orderable](t, e1, e2, forwardArgs(msg, args))
}
// GreaterTf is the same as [GreaterT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterTf[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.GreaterT[Orderable](t, e1, e2, forwardArgs(msg, args))
}
// HTTPBodyContainsf is the same as [HTTPBodyContains], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPBodyContainsf(t T, handler http.HandlerFunc, method string, url string, values url.Values, str any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPBodyContains(t, handler, method, url, values, str, forwardArgs(msg, args))
}
// HTTPBodyNotContainsf is the same as [HTTPBodyNotContains], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPBodyNotContainsf(t T, handler http.HandlerFunc, method string, url string, values url.Values, str any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPBodyNotContains(t, handler, method, url, values, str, forwardArgs(msg, args))
}
// HTTPErrorf is the same as [HTTPError], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPErrorf(t T, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPError(t, handler, method, url, values, forwardArgs(msg, args))
}
// HTTPRedirectf is the same as [HTTPRedirect], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPRedirectf(t T, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPRedirect(t, handler, method, url, values, forwardArgs(msg, args))
}
// HTTPStatusCodef is the same as [HTTPStatusCode], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPStatusCodef(t T, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPStatusCode(t, handler, method, url, values, statuscode, forwardArgs(msg, args))
}
// HTTPSuccessf is the same as [HTTPSuccess], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPSuccessf(t T, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.HTTPSuccess(t, handler, method, url, values, forwardArgs(msg, args))
}
// Implementsf is the same as [Implements], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Implementsf(t T, interfaceObject any, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Implements(t, interfaceObject, object, forwardArgs(msg, args))
}
// InDeltaf is the same as [InDelta], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaf(t T, expected any, actual any, delta float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InDelta(t, expected, actual, delta, forwardArgs(msg, args))
}
// InDeltaMapValuesf is the same as [InDeltaMapValues], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaMapValuesf(t T, expected any, actual any, delta float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InDeltaMapValues(t, expected, actual, delta, forwardArgs(msg, args))
}
// InDeltaSlicef is the same as [InDeltaSlice], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaSlicef(t T, expected any, actual any, delta float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InDeltaSlice(t, expected, actual, delta, forwardArgs(msg, args))
}
// InDeltaTf is the same as [InDeltaT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaTf[Number Measurable](t T, expected Number, actual Number, delta Number, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InDeltaT[Number](t, expected, actual, delta, forwardArgs(msg, args))
}
// InEpsilonf is the same as [InEpsilon], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonf(t T, expected any, actual any, epsilon float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InEpsilon(t, expected, actual, epsilon, forwardArgs(msg, args))
}
// InEpsilonSlicef is the same as [InEpsilonSlice], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonSlicef(t T, expected any, actual any, epsilon float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InEpsilonSlice(t, expected, actual, epsilon, forwardArgs(msg, args))
}
// InEpsilonTf is the same as [InEpsilonT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonTf[Number Measurable](t T, expected Number, actual Number, epsilon float64, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.InEpsilonT[Number](t, expected, actual, epsilon, forwardArgs(msg, args))
}
// IsDecreasingf is the same as [IsDecreasing], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsDecreasingf(t T, collection any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsDecreasing(t, collection, forwardArgs(msg, args))
}
// IsDecreasingTf is the same as [IsDecreasingT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsDecreasingTf[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsDecreasingT[OrderedSlice, E](t, collection, forwardArgs(msg, args))
}
// IsIncreasingf is the same as [IsIncreasing], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsIncreasingf(t T, collection any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsIncreasing(t, collection, forwardArgs(msg, args))
}
// IsIncreasingTf is the same as [IsIncreasingT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsIncreasingTf[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsIncreasingT[OrderedSlice, E](t, collection, forwardArgs(msg, args))
}
// IsNonDecreasingf is the same as [IsNonDecreasing], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonDecreasingf(t T, collection any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNonDecreasing(t, collection, forwardArgs(msg, args))
}
// IsNonDecreasingTf is the same as [IsNonDecreasingT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonDecreasingTf[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNonDecreasingT[OrderedSlice, E](t, collection, forwardArgs(msg, args))
}
// IsNonIncreasingf is the same as [IsNonIncreasing], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonIncreasingf(t T, collection any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNonIncreasing(t, collection, forwardArgs(msg, args))
}
// IsNonIncreasingTf is the same as [IsNonIncreasingT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonIncreasingTf[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNonIncreasingT[OrderedSlice, E](t, collection, forwardArgs(msg, args))
}
// IsNotOfTypeTf is the same as [IsNotOfTypeT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNotOfTypeTf[EType any](t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNotOfTypeT[EType](t, object, forwardArgs(msg, args))
}
// IsNotTypef is the same as [IsNotType], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNotTypef(t T, theType any, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsNotType(t, theType, object, forwardArgs(msg, args))
}
// IsOfTypeTf is the same as [IsOfTypeT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsOfTypeTf[EType any](t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsOfTypeT[EType](t, object, forwardArgs(msg, args))
}
// IsTypef is the same as [IsType], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsTypef(t T, expectedType any, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.IsType(t, expectedType, object, forwardArgs(msg, args))
}
// JSONEqf is the same as [JSONEq], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEqf(t T, expected string, actual string, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.JSONEq(t, expected, actual, forwardArgs(msg, args))
}
// JSONEqBytesf is the same as [JSONEqBytes], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEqBytesf(t T, expected []byte, actual []byte, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.JSONEqBytes(t, expected, actual, forwardArgs(msg, args))
}
// JSONEqTf is the same as [JSONEqT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEqTf[EDoc, ADoc Text](t T, expected EDoc, actual ADoc, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.JSONEqT[EDoc, ADoc](t, expected, actual, forwardArgs(msg, args))
}
// JSONMarshalAsTf is the same as [JSONMarshalAsT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONMarshalAsTf[EDoc Text](t T, expected EDoc, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.JSONMarshalAsT[EDoc](t, expected, object, forwardArgs(msg, args))
}
// JSONUnmarshalAsTf is the same as [JSONUnmarshalAsT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONUnmarshalAsTf[Object any, ADoc Text](t T, expected Object, jazon ADoc, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.JSONUnmarshalAsT[Object, ADoc](t, expected, jazon, forwardArgs(msg, args))
}
// Kindf is the same as [Kind], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Kindf(t T, expectedKind reflect.Kind, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Kind(t, expectedKind, object, forwardArgs(msg, args))
}
// Lenf is the same as [Len], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Lenf(t T, object any, length int, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Len(t, object, length, forwardArgs(msg, args))
}
// Lessf is the same as [Less], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Lessf(t T, e1 any, e2 any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Less(t, e1, e2, forwardArgs(msg, args))
}
// LessOrEqualf is the same as [LessOrEqual], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessOrEqualf(t T, e1 any, e2 any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.LessOrEqual(t, e1, e2, forwardArgs(msg, args))
}
// LessOrEqualTf is the same as [LessOrEqualT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessOrEqualTf[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.LessOrEqualT[Orderable](t, e1, e2, forwardArgs(msg, args))
}
// LessTf is the same as [LessT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessTf[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.LessT[Orderable](t, e1, e2, forwardArgs(msg, args))
}
// MapContainsTf is the same as [MapContainsT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func MapContainsTf[Map ~map[K]V, K comparable, V any](t T, m Map, key K, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.MapContainsT[Map, K, V](t, m, key, forwardArgs(msg, args))
}
// MapNotContainsTf is the same as [MapNotContainsT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func MapNotContainsTf[Map ~map[K]V, K comparable, V any](t T, m Map, key K, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.MapNotContainsT[Map, K, V](t, m, key, forwardArgs(msg, args))
}
// Negativef is the same as [Negative], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Negativef(t T, e any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Negative(t, e, forwardArgs(msg, args))
}
// NegativeTf is the same as [NegativeT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NegativeTf[SignedNumber SignedNumeric](t T, e SignedNumber, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NegativeT[SignedNumber](t, e, forwardArgs(msg, args))
}
// Neverf is the same as [Never], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Neverf(t T, condition func() bool, timeout time.Duration, tick time.Duration, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Never(t, condition, timeout, tick, forwardArgs(msg, args))
}
// Nilf is the same as [Nil], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Nilf(t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.Nil(t, object, forwardArgs(msg, args))
}
// NoErrorf is the same as [NoError], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoErrorf(t T, err error, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NoError(t, err, forwardArgs(msg, args))
}
// NoFileDescriptorLeakf is the same as [NoFileDescriptorLeak], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoFileDescriptorLeakf(t T, tested func(), msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NoFileDescriptorLeak(t, tested, forwardArgs(msg, args))
}
// NoGoRoutineLeakf is the same as [NoGoRoutineLeak], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoGoRoutineLeakf(t T, tested func(), msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NoGoRoutineLeak(t, tested, forwardArgs(msg, args))
}
// NotContainsf is the same as [NotContains], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotContainsf(t T, s any, contains any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotContains(t, s, contains, forwardArgs(msg, args))
}
// NotElementsMatchf is the same as [NotElementsMatch], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotElementsMatchf(t T, listA any, listB any, msg string, args ...any) (ok bool) {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotElementsMatch(t, listA, listB, forwardArgs(msg, args))
}
// NotElementsMatchTf is the same as [NotElementsMatchT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotElementsMatchTf[E comparable](t T, listA []E, listB []E, msg string, args ...any) (ok bool) {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotElementsMatchT[E](t, listA, listB, forwardArgs(msg, args))
}
// NotEmptyf is the same as [NotEmpty], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEmptyf(t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotEmpty(t, object, forwardArgs(msg, args))
}
// NotEqualf is the same as [NotEqual], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqualf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotEqual(t, expected, actual, forwardArgs(msg, args))
}
// NotEqualTf is the same as [NotEqualT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqualTf[V comparable](t T, expected V, actual V, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotEqualT[V](t, expected, actual, forwardArgs(msg, args))
}
// NotEqualValuesf is the same as [NotEqualValues], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqualValuesf(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotEqualValues(t, expected, actual, forwardArgs(msg, args))
}
// NotErrorAsf is the same as [NotErrorAs], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotErrorAsf(t T, err error, target any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotErrorAs(t, err, target, forwardArgs(msg, args))
}
// NotErrorIsf is the same as [NotErrorIs], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotErrorIsf(t T, err error, target error, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotErrorIs(t, err, target, forwardArgs(msg, args))
}
// NotImplementsf is the same as [NotImplements], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotImplementsf(t T, interfaceObject any, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotImplements(t, interfaceObject, object, forwardArgs(msg, args))
}
// NotKindf is the same as [NotKind], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotKindf(t T, expectedKind reflect.Kind, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotKind(t, expectedKind, object, forwardArgs(msg, args))
}
// NotNilf is the same as [NotNil], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotNilf(t T, object any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotNil(t, object, forwardArgs(msg, args))
}
// NotPanicsf is the same as [NotPanics], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotPanicsf(t T, f func(), msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotPanics(t, f, forwardArgs(msg, args))
}
// NotRegexpf is the same as [NotRegexp], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotRegexpf(t T, rx any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotRegexp(t, rx, actual, forwardArgs(msg, args))
}
// NotRegexpTf is the same as [NotRegexpT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotRegexpTf[Rex RegExp, ADoc Text](t T, rx Rex, actual ADoc, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotRegexpT[Rex, ADoc](t, rx, actual, forwardArgs(msg, args))
}
// NotSamef is the same as [NotSame], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSamef(t T, expected any, actual any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotSame(t, expected, actual, forwardArgs(msg, args))
}
// NotSameTf is the same as [NotSameT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSameTf[P any](t T, expected *P, actual *P, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotSameT[P](t, expected, actual, forwardArgs(msg, args))
}
// NotSortedTf is the same as [NotSortedT], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSortedTf[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotSortedT[OrderedSlice, E](t, collection, forwardArgs(msg, args))
}
// NotSubsetf is the same as [NotSubset], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSubsetf(t T, list any, subset any, msg string, args ...any) (ok bool) {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotSubset(t, list, subset, forwardArgs(msg, args))
}
// NotZerof is the same as [NotZero], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotZerof(t T, i any, msg string, args ...any) bool {
if h, ok := t.(H); ok {
h.Helper()
}
return assertions.NotZero(t, i, forwardArgs(msg, args))
}
// Panicsf is the same as [Panics], but it accepts a format string to format arguments like [fmt.Printf].
//
// Upon failure, the test [T] is marked as failed and continues execution.