@@ -34,6 +34,8 @@ const constants = fs.constants;
34
34
/* eslint-disable no-undef */
35
35
common . allowGlobals ( externalizeString , isOneByteString , x ) ;
36
36
37
+ common . refreshTmpDir ( ) ;
38
+
37
39
{
38
40
const expected = 'ümlaut eins' ; // Must be a unique string.
39
41
externalizeString ( expected ) ;
@@ -74,8 +76,6 @@ common.allowGlobals(externalizeString, isOneByteString, x);
74
76
assert . strictEqual ( expected , fs . readFileSync ( fn , 'utf8' ) ) ;
75
77
}
76
78
77
- common . refreshTmpDir ( ) ;
78
-
79
79
fs . open ( fn , 'w' , 0o644 , common . mustCall ( function ( err , fd ) {
80
80
assert . ifError ( err ) ;
81
81
@@ -91,10 +91,10 @@ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) {
91
91
const written = common . mustCall ( function ( err , written ) {
92
92
assert . ifError ( err ) ;
93
93
assert . strictEqual ( 0 , written ) ;
94
+ fs . write ( fd , expected , 0 , 'utf8' , done ) ;
94
95
} ) ;
95
96
96
97
fs . write ( fd , '' , 0 , 'utf8' , written ) ;
97
- fs . write ( fd , expected , 0 , 'utf8' , done ) ;
98
98
} ) ) ;
99
99
100
100
const args = constants . O_CREAT | constants . O_WRONLY | constants . O_TRUNC ;
@@ -113,10 +113,10 @@ fs.open(fn2, args, 0o644, common.mustCall((err, fd) => {
113
113
const written = common . mustCall ( function ( err , written ) {
114
114
assert . ifError ( err ) ;
115
115
assert . strictEqual ( 0 , written ) ;
116
+ fs . write ( fd , expected , 0 , 'utf8' , done ) ;
116
117
} ) ;
117
118
118
119
fs . write ( fd , '' , 0 , 'utf8' , written ) ;
119
- fs . write ( fd , expected , 0 , 'utf8' , done ) ;
120
120
} ) ) ;
121
121
122
122
fs . open ( fn3 , 'w' , 0o644 , common . mustCall ( function ( err , fd ) {
0 commit comments