From 269f70c12ab8eaeff2da8e0f32ebcfffcb794d8f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 24 Sep 2015 12:15:18 +0800 Subject: [PATCH] spec: Reading asar file should not leak fd --- spec/asar-spec.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/asar-spec.coffee b/spec/asar-spec.coffee index 4ef9337f3a..1e6ee69103 100644 --- a/spec/asar-spec.coffee +++ b/spec/asar-spec.coffee @@ -8,6 +8,10 @@ describe 'asar package', -> describe 'node api', -> describe 'fs.readFileSync', -> + it 'does not leak fd', -> + for i in [1..10000] + fs.readFileSync(path.join(process.resourcesPath, 'atom.asar', 'renderer', 'api', 'lib', 'ipc.js')) + it 'reads a normal file', -> file1 = path.join fixtures, 'asar', 'a.asar', 'file1' assert.equal fs.readFileSync(file1).toString().trim(), 'file1'