@@ -48,13 +48,15 @@ const (
48
48
const officialTestOutputPrefix = " "
49
49
50
50
// NoImplementation always fails with no implementation.
51
+ // Deprecated: use e.g. assert.NotImplemented(), only default asserter is used.
51
52
func (asserter Asserter ) NoImplementation (a ... any ) {
52
53
asserter .reportAssertionFault ("not implemented" , a ... )
53
54
}
54
55
55
56
// True asserts that term is true. If not it panics with the given formatting
56
57
// string. Note! This and Truef are the most performant of all the assertion
57
58
// functions.
59
+ // Deprecated: use e.g. assert.That(), only default asserter is used.
58
60
func (asserter Asserter ) True (term bool , a ... any ) {
59
61
if ! term {
60
62
asserter .reportAssertionFault ("assertion fault" , a ... )
@@ -63,6 +65,7 @@ func (asserter Asserter) True(term bool, a ...any) {
63
65
64
66
// Truef asserts that term is true. If not it panics with the given formatting
65
67
// string.
68
+ // Deprecated: use e.g. assert.That(), only default asserter is used.
66
69
func (asserter Asserter ) Truef (term bool , format string , a ... any ) {
67
70
if ! term {
68
71
if asserter .hasStackTrace () {
@@ -76,6 +79,7 @@ func (asserter Asserter) Truef(term bool, format string, a ...any) {
76
79
// panics/errors (current Asserter) with the given msg. Note! This is very slow
77
80
// (before we have generics). If you need performance use EqualInt. It's not so
78
81
// convenient, though.
82
+ // Deprecated: use e.g. assert.Len(), only default asserter is used.
79
83
func (asserter Asserter ) Len (obj any , length int , a ... any ) {
80
84
ok , l := getLen (obj )
81
85
if ! ok {
@@ -90,6 +94,7 @@ func (asserter Asserter) Len(obj any, length int, a ...any) {
90
94
91
95
// EqualInt asserts that integers are equal. If not it panics/errors (current
92
96
// Asserter) with the given msg.
97
+ // Deprecated: use e.g. assert.Equal(), only default asserter is used.
93
98
func (asserter Asserter ) EqualInt (val , want int , a ... any ) {
94
99
if want != val {
95
100
defMsg := fmt .Sprintf ("got %d, want %d" , val , want )
@@ -101,13 +106,15 @@ func (asserter Asserter) EqualInt(val, want int, a ...any) {
101
106
// panics/errors (current Asserter) with the given msg. Note! This is very slow
102
107
// (before we have generics). If you need performance use EqualInt. It's not so
103
108
// convenient, though.
109
+ // Deprecated: use e.g. assert.Len(), only default asserter is used.
104
110
func (asserter Asserter ) Lenf (obj any , length int , format string , a ... any ) {
105
111
args := combineArgs (format , a )
106
112
asserter .Len (obj , length , args ... )
107
113
}
108
114
109
115
// Empty asserts that length of the object is zero. If not it panics with the
110
116
// given formatting string. Note! This is slow.
117
+ // Deprecated: use e.g. assert.Empty(), only default asserter is used.
111
118
func (asserter Asserter ) Empty (obj any , msg ... any ) {
112
119
ok , l := getLen (obj )
113
120
if ! ok {
@@ -122,13 +129,15 @@ func (asserter Asserter) Empty(obj any, msg ...any) {
122
129
123
130
// NotEmptyf asserts that length of the object greater than zero. If not it
124
131
// panics with the given formatting string. Note! This is slow.
132
+ // Deprecated: use e.g. assert.NotEmpty(), only default asserter is used.
125
133
func (asserter Asserter ) NotEmptyf (obj any , format string , msg ... any ) {
126
134
args := combineArgs (format , msg )
127
135
asserter .Empty (obj , args ... )
128
136
}
129
137
130
138
// NotEmpty asserts that length of the object greater than zero. If not it
131
139
// panics with the given formatting string. Note! This is slow.
140
+ // Deprecated: use e.g. assert.NotEmpty(), only default asserter is used.
132
141
func (asserter Asserter ) NotEmpty (obj any , msg ... any ) {
133
142
ok , l := getLen (obj )
134
143
if ! ok {
0 commit comments