@@ -125,7 +125,7 @@ test('a most basic test', function(t) {
125
125
'xxxxxxxxxxxxxxxxxxxxx' ] ;
126
126
127
127
r . on ( 'end' , function ( ) {
128
- t . same ( reads , expect ) ;
128
+ assert . deepStrictEqual ( reads , expect ) ;
129
129
t . end ( ) ;
130
130
} ) ;
131
131
@@ -158,7 +158,7 @@ test('pipe', function(t) {
158
158
const w = new TestWriter ( ) ;
159
159
160
160
w . on ( 'end' , function ( received ) {
161
- t . same ( received , expect ) ;
161
+ assert . deepStrictEqual ( received , expect ) ;
162
162
t . end ( ) ;
163
163
} ) ;
164
164
@@ -204,15 +204,15 @@ test('pipe', function(t) {
204
204
t . equal ( ended0 , false ) ;
205
205
ended0 = true ;
206
206
ended ++ ;
207
- t . same ( results , expect [ 0 ] ) ;
207
+ assert . deepStrictEqual ( results , expect [ 0 ] ) ;
208
208
} ) ;
209
209
210
210
w [ 1 ] . on ( 'end' , function ( results ) {
211
211
t . equal ( ended1 , false ) ;
212
212
ended1 = true ;
213
213
ended ++ ;
214
214
t . equal ( ended , 2 ) ;
215
- t . same ( results , expect [ 1 ] ) ;
215
+ assert . deepStrictEqual ( results , expect [ 1 ] ) ;
216
216
t . end ( ) ;
217
217
} ) ;
218
218
@@ -239,11 +239,11 @@ test('multipipe', function(t) {
239
239
240
240
let c = 2 ;
241
241
w [ 0 ] . on ( 'end' , function ( received ) {
242
- t . same ( received , expect , 'first' ) ;
242
+ assert . deepStrictEqual ( received , expect , 'first' ) ;
243
243
if ( -- c === 0 ) t . end ( ) ;
244
244
} ) ;
245
245
w [ 1 ] . on ( 'end' , function ( received ) {
246
- t . same ( received , expect , 'second' ) ;
246
+ assert . deepStrictEqual ( received , expect , 'second' ) ;
247
247
if ( -- c === 0 ) t . end ( ) ;
248
248
} ) ;
249
249
@@ -284,13 +284,13 @@ test('multipipe', function(t) {
284
284
285
285
w [ 0 ] . on ( 'end' , function ( results ) {
286
286
ended ++ ;
287
- t . same ( results , expect [ 0 ] ) ;
287
+ assert . deepStrictEqual ( results , expect [ 0 ] ) ;
288
288
} ) ;
289
289
290
290
w [ 1 ] . on ( 'end' , function ( results ) {
291
291
ended ++ ;
292
292
t . equal ( ended , 2 ) ;
293
- t . same ( results , expect [ 1 ] ) ;
293
+ assert . deepStrictEqual ( results , expect [ 1 ] ) ;
294
294
t . end ( ) ;
295
295
} ) ;
296
296
@@ -300,10 +300,8 @@ test('multipipe', function(t) {
300
300
} ) ;
301
301
302
302
test ( 'back pressure respected' , function ( t ) {
303
- function noop ( ) { }
304
-
305
303
const r = new R ( { objectMode : true } ) ;
306
- r . _read = noop ;
304
+ r . _read = common . mustNotCall ( ) ;
307
305
let counter = 0 ;
308
306
r . push ( [ 'one' ] ) ;
309
307
r . push ( [ 'two' ] ) ;
@@ -321,7 +319,7 @@ test('back pressure respected', function(t) {
321
319
r . pipe ( w3 ) ;
322
320
} ) ;
323
321
} ;
324
- w1 . end = noop ;
322
+ w1 . end = common . mustNotCall ( ) ;
325
323
326
324
r . pipe ( w1 ) ;
327
325
@@ -347,7 +345,7 @@ test('back pressure respected', function(t) {
347
345
348
346
return false ;
349
347
} ;
350
- w2 . end = noop ;
348
+ w2 . end = common . mustCall ( ) ;
351
349
352
350
let w3 = new R ( ) ;
353
351
w3 . write = function ( chunk ) {
@@ -380,7 +378,7 @@ test('read(0) for ended streams', function(t) {
380
378
const r = new R ( ) ;
381
379
let written = false ;
382
380
let ended = false ;
383
- r . _read = function ( n ) { } ;
381
+ r . _read = common . mustNotCall ( ) ;
384
382
385
383
r . push ( Buffer . from ( 'foo' ) ) ;
386
384
r . push ( null ) ;
@@ -451,7 +449,7 @@ test('adding readable triggers data flow', function(t) {
451
449
452
450
test ( 'chainable' , function ( t ) {
453
451
const r = new R ( ) ;
454
- r . _read = common . noop ;
452
+ r . _read = common . mustCall ( ) ;
455
453
const r2 = r . setEncoding ( 'utf8' ) . pause ( ) . resume ( ) . pause ( ) ;
456
454
t . equal ( r , r2 ) ;
457
455
t . end ( ) ;
0 commit comments