This prevents fixture litter when these tests fail.
'它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n';
// test that empty file will be created and have content added
-var filename = join(common.fixturesDir, 'append-sync.txt');
+var filename = join(common.tmpDir, 'append-sync.txt');
common.error('appending to ' + filename);
fs.appendFileSync(filename, data);
var fileData = fs.readFileSync(filename);
+console.error('filedata is a ' + typeof fileData);
assert.equal(Buffer.byteLength(data), fileData.length);
// test that appends data to a non empty file
-var filename2 = join(common.fixturesDir, 'append-sync2.txt');
+var filename2 = join(common.tmpDir, 'append-sync2.txt');
fs.writeFileSync(filename2, currentFileData);
common.error('appending to ' + filename2);
fileData2.length);
// test that appendFileSync accepts buffers
-var filename3 = join(common.fixturesDir, 'append-sync3.txt');
+var filename3 = join(common.tmpDir, 'append-sync3.txt');
fs.writeFileSync(filename3, currentFileData);
common.error('appending to ' + filename3);
assert.equal(buf.length + currentFileData.length, fileData3.length);
// test that appendFile accepts numbers.
-var filename4 = join(common.fixturesDir, 'append-sync4.txt');
+var filename4 = join(common.tmpDir, 'append-sync4.txt');
fs.writeFileSync(filename4, currentFileData);
common.error('appending to ' + filename4);
var fs = require('fs');
var join = require('path').join;
-var filename = join(common.fixturesDir, 'append.txt');
+var filename = join(common.tmpDir, 'append.txt');
common.error('appending to ' + filename);
});
// test that appends data to a non empty file
-var filename2 = join(common.fixturesDir, 'append2.txt');
+var filename2 = join(common.tmpDir, 'append2.txt');
fs.writeFileSync(filename2, currentFileData);
fs.appendFile(filename2, s, function(e) {
});
// test that appendFile accepts buffers
-var filename3 = join(common.fixturesDir, 'append3.txt');
+var filename3 = join(common.tmpDir, 'append3.txt');
fs.writeFileSync(filename3, currentFileData);
var buf = new Buffer(s, 'utf8');
});
// test that appendFile accepts numbers.
-var filename4 = join(common.fixturesDir, 'append4.txt');
+var filename4 = join(common.tmpDir, 'append4.txt');
fs.writeFileSync(filename4, currentFileData);
common.error('appending to ' + filename4);
var fs = require('fs');
var join = require('path').join;
-var filename = join(common.fixturesDir, 'test.txt');
+var filename = join(common.tmpDir, 'test.txt');
common.error('writing to ' + filename);
});
// test that writeFile accepts buffers
-var filename2 = join(common.fixturesDir, 'test2.txt');
+var filename2 = join(common.tmpDir, 'test2.txt');
var buf = new Buffer(s, 'utf8');
common.error('writing to ' + filename2);
});
// test that writeFile accepts numbers.
-var filename3 = join(common.fixturesDir, 'test3.txt');
+var filename3 = join(common.tmpDir, 'test3.txt');
common.error('writing to ' + filename3);
fs.writeFile(filename3, n, function(e) {