11'use strict' ;
2- var common = require ( '../common' ) ;
3- var assert = require ( 'assert' ) ;
4- var path = require ( 'path' ) ;
5- var Buffer = require ( 'buffer' ) . Buffer ;
6- var fs = require ( 'fs' ) ;
7- var fn = path . join ( common . tmpDir , 'write.txt' ) ;
8- var fn2 = path . join ( common . tmpDir , 'write2.txt' ) ;
9- var expected = 'ümlaut.' ;
10- var constants = fs . constants ;
2+ const common = require ( '../common' ) ;
3+ const assert = require ( 'assert' ) ;
4+ const path = require ( 'path' ) ;
5+ const Buffer = require ( 'buffer' ) . Buffer ;
6+ const fs = require ( 'fs' ) ;
7+ const fn = path . join ( common . tmpDir , 'write.txt' ) ;
8+ const fn2 = path . join ( common . tmpDir , 'write2.txt' ) ;
9+ const expected = 'ümlaut.' ;
10+ const constants = fs . constants ;
1111
1212common . refreshTmpDir ( ) ;
1313
1414fs . open ( fn , 'w' , 0o644 , common . mustCall ( function ( err , fd ) {
1515 if ( err ) throw err ;
1616 console . log ( 'open done' ) ;
1717 fs . write ( fd , '' , 0 , 'utf8' , function ( err , written ) {
18- assert . equal ( 0 , written ) ;
18+ assert . strictEqual ( 0 , written ) ;
1919 } ) ;
2020 fs . write ( fd , expected , 0 , 'utf8' , common . mustCall ( function ( err , written ) {
2121 console . log ( 'write done' ) ;
2222 if ( err ) throw err ;
23- assert . equal ( Buffer . byteLength ( expected ) , written ) ;
23+ assert . strictEqual ( Buffer . byteLength ( expected ) , written ) ;
2424 fs . closeSync ( fd ) ;
2525 const found = fs . readFileSync ( fn , 'utf8' ) ;
2626 console . log ( 'expected: "%s"' , expected ) ;
@@ -36,12 +36,12 @@ fs.open(fn2, constants.O_CREAT | constants.O_WRONLY | constants.O_TRUNC, 0o644,
3636 if ( err ) throw err ;
3737 console . log ( 'open done' ) ;
3838 fs . write ( fd , '' , 0 , 'utf8' , ( err , written ) => {
39- assert . equal ( 0 , written ) ;
39+ assert . strictEqual ( 0 , written ) ;
4040 } ) ;
4141 fs . write ( fd , expected , 0 , 'utf8' , common . mustCall ( ( err , written ) => {
4242 console . log ( 'write done' ) ;
4343 if ( err ) throw err ;
44- assert . equal ( Buffer . byteLength ( expected ) , written ) ;
44+ assert . strictEqual ( Buffer . byteLength ( expected ) , written ) ;
4545 fs . closeSync ( fd ) ;
4646 const found = fs . readFileSync ( fn2 , 'utf8' ) ;
4747 console . log ( 'expected: "%s"' , expected ) ;
0 commit comments