2010-12-05 07:20:34 +08:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
2010-05-14 03:42:17 +08:00
|
|
|
|
|
|
|
var
|
|
|
|
path = require('path'),
|
|
|
|
fs = require('fs'),
|
2010-07-16 02:47:25 +08:00
|
|
|
fn = path.join(common.fixturesDir, 'empty.txt');
|
2010-05-14 03:42:17 +08:00
|
|
|
|
|
|
|
fs.readFile(fn, function(err, data) {
|
|
|
|
assert.ok(data);
|
2010-06-24 08:40:51 +08:00
|
|
|
});
|
2010-08-25 12:36:08 +08:00
|
|
|
|
|
|
|
fs.readFile(fn, 'utf8', function(err, data) {
|
|
|
|
assert.strictEqual('', data);
|
2010-10-05 03:22:59 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
assert.ok(fs.readFileSync(fn));
|
|
|
|
assert.strictEqual('', fs.readFileSync(fn, 'utf8'));
|