2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-01-13 21:42:45 +01:00
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
const path = require('path');
|
|
|
|
const fs = require('fs');
|
|
|
|
const fn = path.join(common.fixturesDir, 'empty.txt');
|
2010-05-13 12:42:17 -07:00
|
|
|
|
|
|
|
fs.readFile(fn, function(err, data) {
|
|
|
|
assert.ok(data);
|
2010-06-23 17:40:51 -07:00
|
|
|
});
|
2010-08-25 00:36:08 -04:00
|
|
|
|
|
|
|
fs.readFile(fn, 'utf8', function(err, data) {
|
|
|
|
assert.strictEqual('', data);
|
2010-10-04 12:22:59 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
assert.ok(fs.readFileSync(fn));
|
|
|
|
assert.strictEqual('', fs.readFileSync(fn, 'utf8'));
|