@@ -159,17 +159,17 @@ const (
159
159
// be called at the beginning of every test. There is two way of doing it:
160
160
//
161
161
// for _, tt := range tests {
162
- // t.Run(tt.name, func(t *testing.T) { // Shorter way, litle magic
163
- // defer assert.PushTester(t)() // <- IMPORTANT! NOTE! (t)()
164
- // ...
165
- // assert.That(something, "test won't work")
166
- // })
167
- // t.Run(tt.name, func(t *testing.T) { // Longer, explicit way, 2 lines
168
- // assert.PushTester(t) // <- IMPORTANT!
169
- // defer assert.PopTester()
170
- // ...
171
- // assert.That(something, "test won't work")
172
- // })
162
+ // t.Run(tt.name, func(t *testing.T) { // Shorter way, litle magic
163
+ // defer assert.PushTester(t)() // <- IMPORTANT! NOTE! (t)()
164
+ // ...
165
+ // assert.That(something, "test won't work")
166
+ // })
167
+ // t.Run(tt.name, func(t *testing.T) { // Longer, explicit way, 2 lines
168
+ // assert.PushTester(t) // <- IMPORTANT!
169
+ // defer assert.PopTester()
170
+ // ...
171
+ // assert.That(something, "test won't work")
172
+ // })
173
173
// }
174
174
//
175
175
// Because PushTester returns [PopTester] it allows us to merge these two calls
@@ -184,8 +184,8 @@ const (
184
184
// defer assert.PushTester(t)() // does the cleanup
185
185
// ...
186
186
// go func() {
187
- // assert.PushTester(t) // left cleanup out! Leave it for the test, see ^
188
- // ...
187
+ // assert.PushTester(t) // left cleanup out! Leave it for the test, see ^
188
+ // ...
189
189
//
190
190
// Note that the second argument, if given, changes the default asserter for
191
191
// whole package. The argument is mainly for temporary development use and isn't
@@ -209,12 +209,12 @@ func PushTester(t testing.TB, a ...defInd) function {
209
209
// You have two ways to call [PopTester]. With defer right after [PushTester]:
210
210
//
211
211
// for _, tt := range tests {
212
- // t.Run(tt.name, func(t *testing.T) {
213
- // assert.PushTester(t) // <- important!
214
- // defer assert.PopTester() // <- for good girls and not so bad boys
215
- // ...
216
- // assert.That(something, "test won't work")
217
- // })
212
+ // t.Run(tt.name, func(t *testing.T) {
213
+ // assert.PushTester(t) // <- important!
214
+ // defer assert.PopTester() // <- for good girls and not so bad boys
215
+ // ...
216
+ // assert.That(something, "test won't work")
217
+ // })
218
218
// }
219
219
//
220
220
// If you want, you can combine [PushTester] and PopTester to one-liner:
@@ -853,7 +853,7 @@ func current() asserter {
853
853
// and set asserter only one in TestMain, or in init.
854
854
//
855
855
// func TestMain(m *testing.M) {
856
- // SetDefault(assert.TestFull)
856
+ // SetDefault(assert.TestFull)
857
857
func SetDefault (i defInd ) (old defInd ) {
858
858
// pkg lvl lock to allow only one pkg client call this at one of the time
859
859
// together with the indexing, i.e we don't need to switch asserter
0 commit comments