@@ -194,7 +194,7 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...any)
194
194
// EqualValues asserts that two objects are equal or convertible to the larger
195
195
// type and equal.
196
196
//
197
- // assert .EqualValues(t, uint32(123), int32(123))
197
+ // test .EqualValues(t, uint32(123), int32(123))
198
198
func EqualValues (t TestingT , expected , actual interface {}, msgAndArgs ... interface {}) bool {
199
199
if h , ok := t .(tHelper ); ok {
200
200
h .Helper ()
@@ -218,8 +218,8 @@ func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interfa
218
218
// Exported int
219
219
// notExported int
220
220
// }
221
- // assert .EqualExportedValues(t, S{1, 2}, S{1, 3}) => true
222
- // assert .EqualExportedValues(t, S{1, 2}, S{2, 3}) => false
221
+ // test .EqualExportedValues(t, S{1, 2}, S{1, 3}) => true
222
+ // test .EqualExportedValues(t, S{1, 2}, S{2, 3}) => false
223
223
func EqualExportedValues (t TestingT , expected , actual interface {}, msgAndArgs ... interface {}) bool {
224
224
if h , ok := t .(tHelper ); ok {
225
225
h .Helper ()
@@ -247,7 +247,7 @@ func EqualExportedValues(t TestingT, expected, actual interface{}, msgAndArgs ..
247
247
248
248
// NotEqual asserts that the specified values are NOT equal.
249
249
//
250
- // assert .NotEqual(t, obj1, obj2)
250
+ // test .NotEqual(t, obj1, obj2)
251
251
func NotEqual (t TestingT , expected , actual any , msgAndArgs ... any ) bool {
252
252
if h , ok := t .(tHelper ); ok {
253
253
h .Helper ()
@@ -268,7 +268,7 @@ func NotEqual(t TestingT, expected, actual any, msgAndArgs ...any) bool {
268
268
269
269
// NotEqualValues asserts that two objects are not equal even when converted to the same type
270
270
//
271
- // assert .NotEqualValues(t, obj1, obj2)
271
+ // test .NotEqualValues(t, obj1, obj2)
272
272
func NotEqualValues (t TestingT , expected , actual any , msgAndArgs ... interface {}) bool {
273
273
if h , ok := t .(tHelper ); ok {
274
274
h .Helper ()
@@ -323,7 +323,7 @@ func NotSame(t TestingT, expected, actual any, msgAndArgs ...any) bool {
323
323
324
324
// Exactly asserts that two objects are equal in value and type.
325
325
//
326
- // assert .Exactly(t, int32(123), int64(123))
326
+ // test .Exactly(t, int32(123), int64(123))
327
327
func Exactly (t TestingT , expected , actual interface {}, msgAndArgs ... interface {}) bool {
328
328
if h , ok := t .(tHelper ); ok {
329
329
h .Helper ()
@@ -342,7 +342,7 @@ func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}
342
342
343
343
// Nil asserts that the specified object is nil.
344
344
//
345
- // assert .Nil(t, err)
345
+ // test .Nil(t, err)
346
346
func Nil (t TestingT , object any , msgAndArgs ... any ) bool {
347
347
if isNil (object ) {
348
348
return true
@@ -373,7 +373,7 @@ func NotNil(t TestingT, object any, msgAndArgs ...any) bool {
373
373
// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
374
374
// a slice or a channel with len == 0.
375
375
//
376
- // assert .Empty(t, obj)
376
+ // test .Empty(t, obj)
377
377
func Empty (t TestingT , object any , msgAndArgs ... any ) bool {
378
378
pass := isEmpty (object )
379
379
if ! pass {
@@ -391,8 +391,8 @@ func Empty(t TestingT, object any, msgAndArgs ...any) bool {
391
391
// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
392
392
// a slice or a channel with len == 0.
393
393
//
394
- // if assert .NotEmpty(t, obj) {
395
- // assert .Equal(t, "two", obj[1])
394
+ // if test .NotEmpty(t, obj) {
395
+ // test .Equal(t, "two", obj[1])
396
396
// }
397
397
func NotEmpty (t TestingT , object any , msgAndArgs ... any ) bool {
398
398
pass := ! isEmpty (object )
@@ -422,7 +422,7 @@ func getLen(x interface{}) (length int, ok bool) {
422
422
// Len asserts that the specified object has specific length.
423
423
// Len also fails if the object has a type that len() not accept.
424
424
//
425
- // assert .Len(t, mySlice, 3)
425
+ // test .Len(t, mySlice, 3)
426
426
func Len (t TestingT , object interface {}, length int , msgAndArgs ... interface {}) bool {
427
427
if h , ok := t .(tHelper ); ok {
428
428
h .Helper ()
@@ -442,7 +442,7 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
442
442
443
443
// True asserts that the specified value is true.
444
444
//
445
- // assert .True(t, myBool)
445
+ // test .True(t, myBool)
446
446
func True (t TestingT , value bool , msgAndArgs ... any ) bool {
447
447
if ! value {
448
448
if h , ok := t .(tHelper ); ok {
@@ -458,7 +458,7 @@ func True(t TestingT, value bool, msgAndArgs ...any) bool {
458
458
459
459
// False asserts that the specified value is false.
460
460
//
461
- // assert .False(t, myBool)
461
+ // test .False(t, myBool)
462
462
func False (t TestingT , value bool , msgAndArgs ... any ) bool {
463
463
if value {
464
464
if h , ok := t .(tHelper ); ok {
@@ -517,9 +517,9 @@ func containsElement(list interface{}, element interface{}) (ok, found bool) {
517
517
// Contains asserts that the specified string, list(array, slice...) or map contains the
518
518
// specified substring or element.
519
519
//
520
- // assert .Contains(t, "Hello World", "World")
521
- // assert .Contains(t, ["Hello", "World"], "World")
522
- // assert .Contains(t, {"Hello": "World"}, "Hello")
520
+ // test .Contains(t, "Hello World", "World")
521
+ // test .Contains(t, ["Hello", "World"], "World")
522
+ // test .Contains(t, {"Hello": "World"}, "Hello")
523
523
func Contains (t TestingT , s , contains any , msgAndArgs ... any ) bool {
524
524
if h , ok := t .(tHelper ); ok {
525
525
h .Helper ()
@@ -541,9 +541,9 @@ func Contains(t TestingT, s, contains any, msgAndArgs ...any) bool {
541
541
// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
542
542
// specified substring or element.
543
543
//
544
- // assert .NotContains(t, "Hello World", "Earth")
545
- // assert .NotContains(t, ["Hello", "World"], "Earth")
546
- // assert .NotContains(t, {"Hello": "World"}, "Earth")
544
+ // test .NotContains(t, "Hello World", "Earth")
545
+ // test .NotContains(t, ["Hello", "World"], "Earth")
546
+ // test .NotContains(t, {"Hello": "World"}, "Earth")
547
547
func NotContains (t TestingT , s , contains any , msgAndArgs ... any ) bool {
548
548
if h , ok := t .(tHelper ); ok {
549
549
h .Helper ()
@@ -565,8 +565,8 @@ func NotContains(t TestingT, s, contains any, msgAndArgs ...any) bool {
565
565
// Subset asserts that the specified list(array, slice...) or map contains all
566
566
// elements given in the specified subset list(array, slice...) or map.
567
567
//
568
- // assert .Subset(t, [1, 2, 3], [1, 2])
569
- // assert .Subset(t, {"x": 1, "y": 2}, {"x": 1})
568
+ // test .Subset(t, [1, 2, 3], [1, 2])
569
+ // test .Subset(t, {"x": 1, "y": 2}, {"x": 1})
570
570
func Subset (t TestingT , list , subset any , msgAndArgs ... any ) (ok bool ) {
571
571
if h , ok := t .(tHelper ); ok {
572
572
h .Helper ()
@@ -625,8 +625,8 @@ func Subset(t TestingT, list, subset any, msgAndArgs ...any) (ok bool) {
625
625
// contain all elements given in the specified subset list(array, slice...) or
626
626
// map.
627
627
//
628
- // assert .NotSubset(t, [1, 3, 4], [1, 2])
629
- // assert .NotSubset(t, {"x": 1, "y": 2}, {"z": 3})
628
+ // test .NotSubset(t, [1, 3, 4], [1, 2])
629
+ // test .NotSubset(t, {"x": 1, "y": 2}, {"z": 3})
630
630
func NotSubset (t TestingT , list , subset any , msgAndArgs ... any ) (ok bool ) {
631
631
if h , ok := t .(tHelper ); ok {
632
632
h .Helper ()
@@ -853,7 +853,7 @@ func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
853
853
854
854
// WithinDuration asserts that the two times are within duration delta of each other.
855
855
//
856
- // assert .WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
856
+ // test .WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
857
857
func WithinDuration (t TestingT , expected , actual time.Time , delta time.Duration , msgAndArgs ... interface {}) bool {
858
858
if h , ok := t .(tHelper ); ok {
859
859
h .Helper ()
@@ -869,7 +869,7 @@ func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration,
869
869
870
870
// WithinRange asserts that a time is within a time range (inclusive).
871
871
//
872
- // assert .WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
872
+ // test .WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
873
873
func WithinRange (t TestingT , actual , start , end time.Time , msgAndArgs ... interface {}) bool {
874
874
if h , ok := t .(tHelper ); ok {
875
875
h .Helper ()
@@ -908,7 +908,7 @@ func didPanic(f PanicTestFunc) (didPanic bool, message any, stack string) {
908
908
909
909
// Panics asserts that the code inside the specified PanicTestFunc panics.
910
910
//
911
- // assert .Panics(t, func(){ GoCrazy() })
911
+ // test .Panics(t, func(){ GoCrazy() })
912
912
func Panics (t TestingT , f PanicTestFunc , msgAndArgs ... any ) bool {
913
913
if h , ok := t .(tHelper ); ok {
914
914
h .Helper ()
@@ -924,7 +924,7 @@ func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...any) bool {
924
924
// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
925
925
// the recovered panic value equals the expected panic value.
926
926
//
927
- // assert .PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
927
+ // test .PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
928
928
func PanicsWithValue (t TestingT , expected any , f PanicTestFunc , msgAndArgs ... any ) bool {
929
929
if h , ok := t .(tHelper ); ok {
930
930
h .Helper ()
@@ -946,7 +946,7 @@ func PanicsWithValue(t TestingT, expected any, f PanicTestFunc, msgAndArgs ...an
946
946
// panics, and that the recovered panic value is an error that satisfies the
947
947
// EqualError comparison.
948
948
//
949
- // assert .PanicsWithError(t, "crazy error", func(){ GoCrazy() })
949
+ // test .PanicsWithError(t, "crazy error", func(){ GoCrazy() })
950
950
func PanicsWithError (t TestingT , errString string , f PanicTestFunc , msgAndArgs ... any ) bool {
951
951
if h , ok := t .(tHelper ); ok {
952
952
h .Helper ()
@@ -967,7 +967,7 @@ func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs .
967
967
968
968
// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
969
969
//
970
- // assert .NotPanics(t, func(){ RemainCalm() })
970
+ // test .NotPanics(t, func(){ RemainCalm() })
971
971
func NotPanics (t TestingT , f PanicTestFunc , msgAndArgs ... any ) bool {
972
972
if h , ok := t .(tHelper ); ok {
973
973
h .Helper ()
0 commit comments