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