1
2
3 package assert
4
5 import (
6 http "net/http"
7 url "net/url"
8 time "time"
9 )
10
11
12 func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool {
13 if h, ok := a.t.(tHelper); ok {
14 h.Helper()
15 }
16 return Condition(a.t, comp, msgAndArgs...)
17 }
18
19
20 func (a *Assertions) Conditionf(comp Comparison, msg string, args ...interface{}) bool {
21 if h, ok := a.t.(tHelper); ok {
22 h.Helper()
23 }
24 return Conditionf(a.t, comp, msg, args...)
25 }
26
27
28
29
30
31
32
33 func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
34 if h, ok := a.t.(tHelper); ok {
35 h.Helper()
36 }
37 return Contains(a.t, s, contains, msgAndArgs...)
38 }
39
40
41
42
43
44
45
46 func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool {
47 if h, ok := a.t.(tHelper); ok {
48 h.Helper()
49 }
50 return Containsf(a.t, s, contains, msg, args...)
51 }
52
53
54
55 func (a *Assertions) DirExists(path string, msgAndArgs ...interface{}) bool {
56 if h, ok := a.t.(tHelper); ok {
57 h.Helper()
58 }
59 return DirExists(a.t, path, msgAndArgs...)
60 }
61
62
63
64 func (a *Assertions) DirExistsf(path string, msg string, args ...interface{}) bool {
65 if h, ok := a.t.(tHelper); ok {
66 h.Helper()
67 }
68 return DirExistsf(a.t, path, msg, args...)
69 }
70
71
72
73
74
75
76 func (a *Assertions) ElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) bool {
77 if h, ok := a.t.(tHelper); ok {
78 h.Helper()
79 }
80 return ElementsMatch(a.t, listA, listB, msgAndArgs...)
81 }
82
83
84
85
86
87
88 func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) bool {
89 if h, ok := a.t.(tHelper); ok {
90 h.Helper()
91 }
92 return ElementsMatchf(a.t, listA, listB, msg, args...)
93 }
94
95
96
97
98
99 func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool {
100 if h, ok := a.t.(tHelper); ok {
101 h.Helper()
102 }
103 return Empty(a.t, object, msgAndArgs...)
104 }
105
106
107
108
109
110 func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) bool {
111 if h, ok := a.t.(tHelper); ok {
112 h.Helper()
113 }
114 return Emptyf(a.t, object, msg, args...)
115 }
116
117
118
119
120
121
122
123
124 func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
125 if h, ok := a.t.(tHelper); ok {
126 h.Helper()
127 }
128 return Equal(a.t, expected, actual, msgAndArgs...)
129 }
130
131
132
133
134
135
136 func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool {
137 if h, ok := a.t.(tHelper); ok {
138 h.Helper()
139 }
140 return EqualError(a.t, theError, errString, msgAndArgs...)
141 }
142
143
144
145
146
147
148 func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) bool {
149 if h, ok := a.t.(tHelper); ok {
150 h.Helper()
151 }
152 return EqualErrorf(a.t, theError, errString, msg, args...)
153 }
154
155
156
157
158
159
160
161
162
163
164
165 func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
166 if h, ok := a.t.(tHelper); ok {
167 h.Helper()
168 }
169 return EqualExportedValues(a.t, expected, actual, msgAndArgs...)
170 }
171
172
173
174
175
176
177
178
179
180
181
182 func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
183 if h, ok := a.t.(tHelper); ok {
184 h.Helper()
185 }
186 return EqualExportedValuesf(a.t, expected, actual, msg, args...)
187 }
188
189
190
191
192
193 func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
194 if h, ok := a.t.(tHelper); ok {
195 h.Helper()
196 }
197 return EqualValues(a.t, expected, actual, msgAndArgs...)
198 }
199
200
201
202
203
204 func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
205 if h, ok := a.t.(tHelper); ok {
206 h.Helper()
207 }
208 return EqualValuesf(a.t, expected, actual, msg, args...)
209 }
210
211
212
213
214
215
216
217
218 func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
219 if h, ok := a.t.(tHelper); ok {
220 h.Helper()
221 }
222 return Equalf(a.t, expected, actual, msg, args...)
223 }
224
225
226
227
228
229
230
231 func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
232 if h, ok := a.t.(tHelper); ok {
233 h.Helper()
234 }
235 return Error(a.t, err, msgAndArgs...)
236 }
237
238
239
240 func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool {
241 if h, ok := a.t.(tHelper); ok {
242 h.Helper()
243 }
244 return ErrorAs(a.t, err, target, msgAndArgs...)
245 }
246
247
248
249 func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool {
250 if h, ok := a.t.(tHelper); ok {
251 h.Helper()
252 }
253 return ErrorAsf(a.t, err, target, msg, args...)
254 }
255
256
257
258
259
260
261 func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool {
262 if h, ok := a.t.(tHelper); ok {
263 h.Helper()
264 }
265 return ErrorContains(a.t, theError, contains, msgAndArgs...)
266 }
267
268
269
270
271
272
273 func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool {
274 if h, ok := a.t.(tHelper); ok {
275 h.Helper()
276 }
277 return ErrorContainsf(a.t, theError, contains, msg, args...)
278 }
279
280
281
282 func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
283 if h, ok := a.t.(tHelper); ok {
284 h.Helper()
285 }
286 return ErrorIs(a.t, err, target, msgAndArgs...)
287 }
288
289
290
291 func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool {
292 if h, ok := a.t.(tHelper); ok {
293 h.Helper()
294 }
295 return ErrorIsf(a.t, err, target, msg, args...)
296 }
297
298
299
300
301
302
303
304 func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool {
305 if h, ok := a.t.(tHelper); ok {
306 h.Helper()
307 }
308 return Errorf(a.t, err, msg, args...)
309 }
310
311
312
313
314
315 func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
316 if h, ok := a.t.(tHelper); ok {
317 h.Helper()
318 }
319 return Eventually(a.t, condition, waitFor, tick, msgAndArgs...)
320 }
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340 func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
341 if h, ok := a.t.(tHelper); ok {
342 h.Helper()
343 }
344 return EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...)
345 }
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365 func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
366 if h, ok := a.t.(tHelper); ok {
367 h.Helper()
368 }
369 return EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...)
370 }
371
372
373
374
375
376 func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
377 if h, ok := a.t.(tHelper); ok {
378 h.Helper()
379 }
380 return Eventuallyf(a.t, condition, waitFor, tick, msg, args...)
381 }
382
383
384
385
386 func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
387 if h, ok := a.t.(tHelper); ok {
388 h.Helper()
389 }
390 return Exactly(a.t, expected, actual, msgAndArgs...)
391 }
392
393
394
395
396 func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
397 if h, ok := a.t.(tHelper); ok {
398 h.Helper()
399 }
400 return Exactlyf(a.t, expected, actual, msg, args...)
401 }
402
403
404 func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool {
405 if h, ok := a.t.(tHelper); ok {
406 h.Helper()
407 }
408 return Fail(a.t, failureMessage, msgAndArgs...)
409 }
410
411
412 func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool {
413 if h, ok := a.t.(tHelper); ok {
414 h.Helper()
415 }
416 return FailNow(a.t, failureMessage, msgAndArgs...)
417 }
418
419
420 func (a *Assertions) FailNowf(failureMessage string, msg string, args ...interface{}) bool {
421 if h, ok := a.t.(tHelper); ok {
422 h.Helper()
423 }
424 return FailNowf(a.t, failureMessage, msg, args...)
425 }
426
427
428 func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{}) bool {
429 if h, ok := a.t.(tHelper); ok {
430 h.Helper()
431 }
432 return Failf(a.t, failureMessage, msg, args...)
433 }
434
435
436
437
438 func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool {
439 if h, ok := a.t.(tHelper); ok {
440 h.Helper()
441 }
442 return False(a.t, value, msgAndArgs...)
443 }
444
445
446
447
448 func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) bool {
449 if h, ok := a.t.(tHelper); ok {
450 h.Helper()
451 }
452 return Falsef(a.t, value, msg, args...)
453 }
454
455
456
457 func (a *Assertions) FileExists(path string, msgAndArgs ...interface{}) bool {
458 if h, ok := a.t.(tHelper); ok {
459 h.Helper()
460 }
461 return FileExists(a.t, path, msgAndArgs...)
462 }
463
464
465
466 func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) bool {
467 if h, ok := a.t.(tHelper); ok {
468 h.Helper()
469 }
470 return FileExistsf(a.t, path, msg, args...)
471 }
472
473
474
475
476
477
478 func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
479 if h, ok := a.t.(tHelper); ok {
480 h.Helper()
481 }
482 return Greater(a.t, e1, e2, msgAndArgs...)
483 }
484
485
486
487
488
489
490
491 func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
492 if h, ok := a.t.(tHelper); ok {
493 h.Helper()
494 }
495 return GreaterOrEqual(a.t, e1, e2, msgAndArgs...)
496 }
497
498
499
500
501
502
503
504 func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
505 if h, ok := a.t.(tHelper); ok {
506 h.Helper()
507 }
508 return GreaterOrEqualf(a.t, e1, e2, msg, args...)
509 }
510
511
512
513
514
515
516 func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
517 if h, ok := a.t.(tHelper); ok {
518 h.Helper()
519 }
520 return Greaterf(a.t, e1, e2, msg, args...)
521 }
522
523
524
525
526
527
528
529 func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
530 if h, ok := a.t.(tHelper); ok {
531 h.Helper()
532 }
533 return HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...)
534 }
535
536
537
538
539
540
541
542 func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
543 if h, ok := a.t.(tHelper); ok {
544 h.Helper()
545 }
546 return HTTPBodyContainsf(a.t, handler, method, url, values, str, msg, args...)
547 }
548
549
550
551
552
553
554
555 func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
556 if h, ok := a.t.(tHelper); ok {
557 h.Helper()
558 }
559 return HTTPBodyNotContains(a.t, handler, method, url, values, str, msgAndArgs...)
560 }
561
562
563
564
565
566
567
568 func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
569 if h, ok := a.t.(tHelper); ok {
570 h.Helper()
571 }
572 return HTTPBodyNotContainsf(a.t, handler, method, url, values, str, msg, args...)
573 }
574
575
576
577
578
579
580 func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
581 if h, ok := a.t.(tHelper); ok {
582 h.Helper()
583 }
584 return HTTPError(a.t, handler, method, url, values, msgAndArgs...)
585 }
586
587
588
589
590
591
592 func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
593 if h, ok := a.t.(tHelper); ok {
594 h.Helper()
595 }
596 return HTTPErrorf(a.t, handler, method, url, values, msg, args...)
597 }
598
599
600
601
602
603
604 func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
605 if h, ok := a.t.(tHelper); ok {
606 h.Helper()
607 }
608 return HTTPRedirect(a.t, handler, method, url, values, msgAndArgs...)
609 }
610
611
612
613
614
615
616 func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
617 if h, ok := a.t.(tHelper); ok {
618 h.Helper()
619 }
620 return HTTPRedirectf(a.t, handler, method, url, values, msg, args...)
621 }
622
623
624
625
626
627
628 func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool {
629 if h, ok := a.t.(tHelper); ok {
630 h.Helper()
631 }
632 return HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...)
633 }
634
635
636
637
638
639
640 func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
641 if h, ok := a.t.(tHelper); ok {
642 h.Helper()
643 }
644 return HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...)
645 }
646
647
648
649
650
651
652 func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
653 if h, ok := a.t.(tHelper); ok {
654 h.Helper()
655 }
656 return HTTPSuccess(a.t, handler, method, url, values, msgAndArgs...)
657 }
658
659
660
661
662
663
664 func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
665 if h, ok := a.t.(tHelper); ok {
666 h.Helper()
667 }
668 return HTTPSuccessf(a.t, handler, method, url, values, msg, args...)
669 }
670
671
672
673
674 func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
675 if h, ok := a.t.(tHelper); ok {
676 h.Helper()
677 }
678 return Implements(a.t, interfaceObject, object, msgAndArgs...)
679 }
680
681
682
683
684 func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
685 if h, ok := a.t.(tHelper); ok {
686 h.Helper()
687 }
688 return Implementsf(a.t, interfaceObject, object, msg, args...)
689 }
690
691
692
693
694 func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
695 if h, ok := a.t.(tHelper); ok {
696 h.Helper()
697 }
698 return InDelta(a.t, expected, actual, delta, msgAndArgs...)
699 }
700
701
702 func (a *Assertions) InDeltaMapValues(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
703 if h, ok := a.t.(tHelper); ok {
704 h.Helper()
705 }
706 return InDeltaMapValues(a.t, expected, actual, delta, msgAndArgs...)
707 }
708
709
710 func (a *Assertions) InDeltaMapValuesf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
711 if h, ok := a.t.(tHelper); ok {
712 h.Helper()
713 }
714 return InDeltaMapValuesf(a.t, expected, actual, delta, msg, args...)
715 }
716
717
718 func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
719 if h, ok := a.t.(tHelper); ok {
720 h.Helper()
721 }
722 return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...)
723 }
724
725
726 func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
727 if h, ok := a.t.(tHelper); ok {
728 h.Helper()
729 }
730 return InDeltaSlicef(a.t, expected, actual, delta, msg, args...)
731 }
732
733
734
735
736 func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
737 if h, ok := a.t.(tHelper); ok {
738 h.Helper()
739 }
740 return InDeltaf(a.t, expected, actual, delta, msg, args...)
741 }
742
743
744 func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
745 if h, ok := a.t.(tHelper); ok {
746 h.Helper()
747 }
748 return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...)
749 }
750
751
752 func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
753 if h, ok := a.t.(tHelper); ok {
754 h.Helper()
755 }
756 return InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...)
757 }
758
759
760 func (a *Assertions) InEpsilonSlicef(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool {
761 if h, ok := a.t.(tHelper); ok {
762 h.Helper()
763 }
764 return InEpsilonSlicef(a.t, expected, actual, epsilon, msg, args...)
765 }
766
767
768 func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool {
769 if h, ok := a.t.(tHelper); ok {
770 h.Helper()
771 }
772 return InEpsilonf(a.t, expected, actual, epsilon, msg, args...)
773 }
774
775
776
777
778
779
780 func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
781 if h, ok := a.t.(tHelper); ok {
782 h.Helper()
783 }
784 return IsDecreasing(a.t, object, msgAndArgs...)
785 }
786
787
788
789
790
791
792 func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool {
793 if h, ok := a.t.(tHelper); ok {
794 h.Helper()
795 }
796 return IsDecreasingf(a.t, object, msg, args...)
797 }
798
799
800
801
802
803
804 func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
805 if h, ok := a.t.(tHelper); ok {
806 h.Helper()
807 }
808 return IsIncreasing(a.t, object, msgAndArgs...)
809 }
810
811
812
813
814
815
816 func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool {
817 if h, ok := a.t.(tHelper); ok {
818 h.Helper()
819 }
820 return IsIncreasingf(a.t, object, msg, args...)
821 }
822
823
824
825
826
827
828 func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
829 if h, ok := a.t.(tHelper); ok {
830 h.Helper()
831 }
832 return IsNonDecreasing(a.t, object, msgAndArgs...)
833 }
834
835
836
837
838
839
840 func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool {
841 if h, ok := a.t.(tHelper); ok {
842 h.Helper()
843 }
844 return IsNonDecreasingf(a.t, object, msg, args...)
845 }
846
847
848
849
850
851
852 func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
853 if h, ok := a.t.(tHelper); ok {
854 h.Helper()
855 }
856 return IsNonIncreasing(a.t, object, msgAndArgs...)
857 }
858
859
860
861
862
863
864 func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool {
865 if h, ok := a.t.(tHelper); ok {
866 h.Helper()
867 }
868 return IsNonIncreasingf(a.t, object, msg, args...)
869 }
870
871
872 func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
873 if h, ok := a.t.(tHelper); ok {
874 h.Helper()
875 }
876 return IsType(a.t, expectedType, object, msgAndArgs...)
877 }
878
879
880 func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg string, args ...interface{}) bool {
881 if h, ok := a.t.(tHelper); ok {
882 h.Helper()
883 }
884 return IsTypef(a.t, expectedType, object, msg, args...)
885 }
886
887
888
889
890 func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool {
891 if h, ok := a.t.(tHelper); ok {
892 h.Helper()
893 }
894 return JSONEq(a.t, expected, actual, msgAndArgs...)
895 }
896
897
898
899
900 func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) bool {
901 if h, ok := a.t.(tHelper); ok {
902 h.Helper()
903 }
904 return JSONEqf(a.t, expected, actual, msg, args...)
905 }
906
907
908
909
910
911 func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool {
912 if h, ok := a.t.(tHelper); ok {
913 h.Helper()
914 }
915 return Len(a.t, object, length, msgAndArgs...)
916 }
917
918
919
920
921
922 func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) bool {
923 if h, ok := a.t.(tHelper); ok {
924 h.Helper()
925 }
926 return Lenf(a.t, object, length, msg, args...)
927 }
928
929
930
931
932
933
934 func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
935 if h, ok := a.t.(tHelper); ok {
936 h.Helper()
937 }
938 return Less(a.t, e1, e2, msgAndArgs...)
939 }
940
941
942
943
944
945
946
947 func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
948 if h, ok := a.t.(tHelper); ok {
949 h.Helper()
950 }
951 return LessOrEqual(a.t, e1, e2, msgAndArgs...)
952 }
953
954
955
956
957
958
959
960 func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
961 if h, ok := a.t.(tHelper); ok {
962 h.Helper()
963 }
964 return LessOrEqualf(a.t, e1, e2, msg, args...)
965 }
966
967
968
969
970
971
972 func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
973 if h, ok := a.t.(tHelper); ok {
974 h.Helper()
975 }
976 return Lessf(a.t, e1, e2, msg, args...)
977 }
978
979
980
981
982
983 func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool {
984 if h, ok := a.t.(tHelper); ok {
985 h.Helper()
986 }
987 return Negative(a.t, e, msgAndArgs...)
988 }
989
990
991
992
993
994 func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool {
995 if h, ok := a.t.(tHelper); ok {
996 h.Helper()
997 }
998 return Negativef(a.t, e, msg, args...)
999 }
1000
1001
1002
1003
1004
1005 func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
1006 if h, ok := a.t.(tHelper); ok {
1007 h.Helper()
1008 }
1009 return Never(a.t, condition, waitFor, tick, msgAndArgs...)
1010 }
1011
1012
1013
1014
1015
1016 func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
1017 if h, ok := a.t.(tHelper); ok {
1018 h.Helper()
1019 }
1020 return Neverf(a.t, condition, waitFor, tick, msg, args...)
1021 }
1022
1023
1024
1025
1026 func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
1027 if h, ok := a.t.(tHelper); ok {
1028 h.Helper()
1029 }
1030 return Nil(a.t, object, msgAndArgs...)
1031 }
1032
1033
1034
1035
1036 func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) bool {
1037 if h, ok := a.t.(tHelper); ok {
1038 h.Helper()
1039 }
1040 return Nilf(a.t, object, msg, args...)
1041 }
1042
1043
1044
1045 func (a *Assertions) NoDirExists(path string, msgAndArgs ...interface{}) bool {
1046 if h, ok := a.t.(tHelper); ok {
1047 h.Helper()
1048 }
1049 return NoDirExists(a.t, path, msgAndArgs...)
1050 }
1051
1052
1053
1054 func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) bool {
1055 if h, ok := a.t.(tHelper); ok {
1056 h.Helper()
1057 }
1058 return NoDirExistsf(a.t, path, msg, args...)
1059 }
1060
1061
1062
1063
1064
1065
1066
1067 func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
1068 if h, ok := a.t.(tHelper); ok {
1069 h.Helper()
1070 }
1071 return NoError(a.t, err, msgAndArgs...)
1072 }
1073
1074
1075
1076
1077
1078
1079
1080 func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) bool {
1081 if h, ok := a.t.(tHelper); ok {
1082 h.Helper()
1083 }
1084 return NoErrorf(a.t, err, msg, args...)
1085 }
1086
1087
1088
1089 func (a *Assertions) NoFileExists(path string, msgAndArgs ...interface{}) bool {
1090 if h, ok := a.t.(tHelper); ok {
1091 h.Helper()
1092 }
1093 return NoFileExists(a.t, path, msgAndArgs...)
1094 }
1095
1096
1097
1098 func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{}) bool {
1099 if h, ok := a.t.(tHelper); ok {
1100 h.Helper()
1101 }
1102 return NoFileExistsf(a.t, path, msg, args...)
1103 }
1104
1105
1106
1107
1108
1109
1110
1111 func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
1112 if h, ok := a.t.(tHelper); ok {
1113 h.Helper()
1114 }
1115 return NotContains(a.t, s, contains, msgAndArgs...)
1116 }
1117
1118
1119
1120
1121
1122
1123
1124 func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool {
1125 if h, ok := a.t.(tHelper); ok {
1126 h.Helper()
1127 }
1128 return NotContainsf(a.t, s, contains, msg, args...)
1129 }
1130
1131
1132
1133
1134
1135
1136
1137 func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool {
1138 if h, ok := a.t.(tHelper); ok {
1139 h.Helper()
1140 }
1141 return NotEmpty(a.t, object, msgAndArgs...)
1142 }
1143
1144
1145
1146
1147
1148
1149
1150 func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) bool {
1151 if h, ok := a.t.(tHelper); ok {
1152 h.Helper()
1153 }
1154 return NotEmptyf(a.t, object, msg, args...)
1155 }
1156
1157
1158
1159
1160
1161
1162
1163 func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
1164 if h, ok := a.t.(tHelper); ok {
1165 h.Helper()
1166 }
1167 return NotEqual(a.t, expected, actual, msgAndArgs...)
1168 }
1169
1170
1171
1172
1173 func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
1174 if h, ok := a.t.(tHelper); ok {
1175 h.Helper()
1176 }
1177 return NotEqualValues(a.t, expected, actual, msgAndArgs...)
1178 }
1179
1180
1181
1182
1183 func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
1184 if h, ok := a.t.(tHelper); ok {
1185 h.Helper()
1186 }
1187 return NotEqualValuesf(a.t, expected, actual, msg, args...)
1188 }
1189
1190
1191
1192
1193
1194
1195
1196 func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
1197 if h, ok := a.t.(tHelper); ok {
1198 h.Helper()
1199 }
1200 return NotEqualf(a.t, expected, actual, msg, args...)
1201 }
1202
1203
1204
1205 func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
1206 if h, ok := a.t.(tHelper); ok {
1207 h.Helper()
1208 }
1209 return NotErrorIs(a.t, err, target, msgAndArgs...)
1210 }
1211
1212
1213
1214 func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool {
1215 if h, ok := a.t.(tHelper); ok {
1216 h.Helper()
1217 }
1218 return NotErrorIsf(a.t, err, target, msg, args...)
1219 }
1220
1221
1222
1223
1224 func (a *Assertions) NotImplements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
1225 if h, ok := a.t.(tHelper); ok {
1226 h.Helper()
1227 }
1228 return NotImplements(a.t, interfaceObject, object, msgAndArgs...)
1229 }
1230
1231
1232
1233
1234 func (a *Assertions) NotImplementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
1235 if h, ok := a.t.(tHelper); ok {
1236 h.Helper()
1237 }
1238 return NotImplementsf(a.t, interfaceObject, object, msg, args...)
1239 }
1240
1241
1242
1243
1244 func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool {
1245 if h, ok := a.t.(tHelper); ok {
1246 h.Helper()
1247 }
1248 return NotNil(a.t, object, msgAndArgs...)
1249 }
1250
1251
1252
1253
1254 func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) bool {
1255 if h, ok := a.t.(tHelper); ok {
1256 h.Helper()
1257 }
1258 return NotNilf(a.t, object, msg, args...)
1259 }
1260
1261
1262
1263
1264 func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
1265 if h, ok := a.t.(tHelper); ok {
1266 h.Helper()
1267 }
1268 return NotPanics(a.t, f, msgAndArgs...)
1269 }
1270
1271
1272
1273
1274 func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{}) bool {
1275 if h, ok := a.t.(tHelper); ok {
1276 h.Helper()
1277 }
1278 return NotPanicsf(a.t, f, msg, args...)
1279 }
1280
1281
1282
1283
1284
1285 func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
1286 if h, ok := a.t.(tHelper); ok {
1287 h.Helper()
1288 }
1289 return NotRegexp(a.t, rx, str, msgAndArgs...)
1290 }
1291
1292
1293
1294
1295
1296 func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
1297 if h, ok := a.t.(tHelper); ok {
1298 h.Helper()
1299 }
1300 return NotRegexpf(a.t, rx, str, msg, args...)
1301 }
1302
1303
1304
1305
1306
1307
1308
1309 func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
1310 if h, ok := a.t.(tHelper); ok {
1311 h.Helper()
1312 }
1313 return NotSame(a.t, expected, actual, msgAndArgs...)
1314 }
1315
1316
1317
1318
1319
1320
1321
1322 func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
1323 if h, ok := a.t.(tHelper); ok {
1324 h.Helper()
1325 }
1326 return NotSamef(a.t, expected, actual, msg, args...)
1327 }
1328
1329
1330
1331
1332
1333
1334
1335 func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool {
1336 if h, ok := a.t.(tHelper); ok {
1337 h.Helper()
1338 }
1339 return NotSubset(a.t, list, subset, msgAndArgs...)
1340 }
1341
1342
1343
1344
1345
1346
1347
1348 func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool {
1349 if h, ok := a.t.(tHelper); ok {
1350 h.Helper()
1351 }
1352 return NotSubsetf(a.t, list, subset, msg, args...)
1353 }
1354
1355
1356 func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool {
1357 if h, ok := a.t.(tHelper); ok {
1358 h.Helper()
1359 }
1360 return NotZero(a.t, i, msgAndArgs...)
1361 }
1362
1363
1364 func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) bool {
1365 if h, ok := a.t.(tHelper); ok {
1366 h.Helper()
1367 }
1368 return NotZerof(a.t, i, msg, args...)
1369 }
1370
1371
1372
1373
1374 func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
1375 if h, ok := a.t.(tHelper); ok {
1376 h.Helper()
1377 }
1378 return Panics(a.t, f, msgAndArgs...)
1379 }
1380
1381
1382
1383
1384
1385
1386 func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool {
1387 if h, ok := a.t.(tHelper); ok {
1388 h.Helper()
1389 }
1390 return PanicsWithError(a.t, errString, f, msgAndArgs...)
1391 }
1392
1393
1394
1395
1396
1397
1398 func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
1399 if h, ok := a.t.(tHelper); ok {
1400 h.Helper()
1401 }
1402 return PanicsWithErrorf(a.t, errString, f, msg, args...)
1403 }
1404
1405
1406
1407
1408
1409 func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool {
1410 if h, ok := a.t.(tHelper); ok {
1411 h.Helper()
1412 }
1413 return PanicsWithValue(a.t, expected, f, msgAndArgs...)
1414 }
1415
1416
1417
1418
1419
1420 func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool {
1421 if h, ok := a.t.(tHelper); ok {
1422 h.Helper()
1423 }
1424 return PanicsWithValuef(a.t, expected, f, msg, args...)
1425 }
1426
1427
1428
1429
1430 func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) bool {
1431 if h, ok := a.t.(tHelper); ok {
1432 h.Helper()
1433 }
1434 return Panicsf(a.t, f, msg, args...)
1435 }
1436
1437
1438
1439
1440
1441 func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool {
1442 if h, ok := a.t.(tHelper); ok {
1443 h.Helper()
1444 }
1445 return Positive(a.t, e, msgAndArgs...)
1446 }
1447
1448
1449
1450
1451
1452 func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool {
1453 if h, ok := a.t.(tHelper); ok {
1454 h.Helper()
1455 }
1456 return Positivef(a.t, e, msg, args...)
1457 }
1458
1459
1460
1461
1462
1463 func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
1464 if h, ok := a.t.(tHelper); ok {
1465 h.Helper()
1466 }
1467 return Regexp(a.t, rx, str, msgAndArgs...)
1468 }
1469
1470
1471
1472
1473
1474 func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
1475 if h, ok := a.t.(tHelper); ok {
1476 h.Helper()
1477 }
1478 return Regexpf(a.t, rx, str, msg, args...)
1479 }
1480
1481
1482
1483
1484
1485
1486
1487 func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
1488 if h, ok := a.t.(tHelper); ok {
1489 h.Helper()
1490 }
1491 return Same(a.t, expected, actual, msgAndArgs...)
1492 }
1493
1494
1495
1496
1497
1498
1499
1500 func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
1501 if h, ok := a.t.(tHelper); ok {
1502 h.Helper()
1503 }
1504 return Samef(a.t, expected, actual, msg, args...)
1505 }
1506
1507
1508
1509
1510
1511
1512 func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool {
1513 if h, ok := a.t.(tHelper); ok {
1514 h.Helper()
1515 }
1516 return Subset(a.t, list, subset, msgAndArgs...)
1517 }
1518
1519
1520
1521
1522
1523
1524 func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool {
1525 if h, ok := a.t.(tHelper); ok {
1526 h.Helper()
1527 }
1528 return Subsetf(a.t, list, subset, msg, args...)
1529 }
1530
1531
1532
1533
1534 func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool {
1535 if h, ok := a.t.(tHelper); ok {
1536 h.Helper()
1537 }
1538 return True(a.t, value, msgAndArgs...)
1539 }
1540
1541
1542
1543
1544 func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool {
1545 if h, ok := a.t.(tHelper); ok {
1546 h.Helper()
1547 }
1548 return Truef(a.t, value, msg, args...)
1549 }
1550
1551
1552
1553
1554 func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
1555 if h, ok := a.t.(tHelper); ok {
1556 h.Helper()
1557 }
1558 return WithinDuration(a.t, expected, actual, delta, msgAndArgs...)
1559 }
1560
1561
1562
1563
1564 func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
1565 if h, ok := a.t.(tHelper); ok {
1566 h.Helper()
1567 }
1568 return WithinDurationf(a.t, expected, actual, delta, msg, args...)
1569 }
1570
1571
1572
1573
1574 func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool {
1575 if h, ok := a.t.(tHelper); ok {
1576 h.Helper()
1577 }
1578 return WithinRange(a.t, actual, start, end, msgAndArgs...)
1579 }
1580
1581
1582
1583
1584 func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool {
1585 if h, ok := a.t.(tHelper); ok {
1586 h.Helper()
1587 }
1588 return WithinRangef(a.t, actual, start, end, msg, args...)
1589 }
1590
1591
1592 func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool {
1593 if h, ok := a.t.(tHelper); ok {
1594 h.Helper()
1595 }
1596 return YAMLEq(a.t, expected, actual, msgAndArgs...)
1597 }
1598
1599
1600 func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) bool {
1601 if h, ok := a.t.(tHelper); ok {
1602 h.Helper()
1603 }
1604 return YAMLEqf(a.t, expected, actual, msg, args...)
1605 }
1606
1607
1608 func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool {
1609 if h, ok := a.t.(tHelper); ok {
1610 h.Helper()
1611 }
1612 return Zero(a.t, i, msgAndArgs...)
1613 }
1614
1615
1616 func (a *Assertions) Zerof(i interface{}, msg string, args ...interface{}) bool {
1617 if h, ok := a.t.(tHelper); ok {
1618 h.Helper()
1619 }
1620 return Zerof(a.t, i, msg, args...)
1621 }
1622
View as plain text