@@ -34,6 +34,8 @@ const constants = fs.constants;
3434/* eslint-disable no-undef */
3535common . allowGlobals ( externalizeString , isOneByteString , x ) ;
3636
37+ common . refreshTmpDir ( ) ;
38+
3739{
3840 const expected = 'ümlaut eins' ; // Must be a unique string.
3941 externalizeString ( expected ) ;
@@ -74,8 +76,6 @@ common.allowGlobals(externalizeString, isOneByteString, x);
7476 assert . strictEqual ( expected , fs . readFileSync ( fn , 'utf8' ) ) ;
7577}
7678
77- common . refreshTmpDir ( ) ;
78-
7979fs . open ( fn , 'w' , 0o644 , common . mustCall ( function ( err , fd ) {
8080 assert . ifError ( err ) ;
8181
@@ -91,10 +91,10 @@ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) {
9191 const written = common . mustCall ( function ( err , written ) {
9292 assert . ifError ( err ) ;
9393 assert . strictEqual ( 0 , written ) ;
94+ fs . write ( fd , expected , 0 , 'utf8' , done ) ;
9495 } ) ;
9596
9697 fs . write ( fd , '' , 0 , 'utf8' , written ) ;
97- fs . write ( fd , expected , 0 , 'utf8' , done ) ;
9898} ) ) ;
9999
100100const args = constants . O_CREAT | constants . O_WRONLY | constants . O_TRUNC ;
@@ -113,10 +113,10 @@ fs.open(fn2, args, 0o644, common.mustCall((err, fd) => {
113113 const written = common . mustCall ( function ( err , written ) {
114114 assert . ifError ( err ) ;
115115 assert . strictEqual ( 0 , written ) ;
116+ fs . write ( fd , expected , 0 , 'utf8' , done ) ;
116117 } ) ;
117118
118119 fs . write ( fd , '' , 0 , 'utf8' , written ) ;
119- fs . write ( fd , expected , 0 , 'utf8' , done ) ;
120120} ) ) ;
121121
122122fs . open ( fn3 , 'w' , 0o644 , common . mustCall ( function ( err , fd ) {
0 commit comments