Test fs.write and fs.writeSync