From 6ef6a830425ecab31ca94a48d12aea30f14e274d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 27 Nov 2015 21:38:43 +0800 Subject: [PATCH] spec: Test execFile and execFileSync --- spec/asar-spec.coffee | 16 ++++++++++++++++ spec/fixtures/asar/echo.asar | Bin 0 -> 18112 bytes 2 files changed, 16 insertions(+) create mode 100644 spec/fixtures/asar/echo.asar diff --git a/spec/asar-spec.coffee b/spec/asar-spec.coffee index ad480a582525..af39fa3ec5ea 100644 --- a/spec/asar-spec.coffee +++ b/spec/asar-spec.coffee @@ -392,6 +392,22 @@ describe 'asar package', -> done() child.send file + describe 'child_process.execFile', -> + return unless process.platform is 'darwin' + + {execFile, execFileSync} = require 'child_process' + echo = path.join fixtures, 'asar', 'echo.asar', 'echo' + + it 'executes binaries', (done) -> + child = execFile echo, ['test'], (error, stdout) -> + assert.equal error, null + assert.equal stdout, 'test\n' + done() + + it 'execFileSync executes binaries', -> + output = execFileSync echo, ['test'] + assert.equal String(output), 'test\n' + describe 'internalModuleReadFile', -> internalModuleReadFile = process.binding('fs').internalModuleReadFile diff --git a/spec/fixtures/asar/echo.asar b/spec/fixtures/asar/echo.asar new file mode 100644 index 0000000000000000000000000000000000000000..4d72f7a92a7bbd6ccc205942348801eea307742e GIT binary patch literal 18112 zcmeHNcUV(N*S|LjO-ewdC<50A76fub6R;5_OQIl1u|o{W1tKKG6pEE1YD5++YeN*p zwV>-OqGA`6RV*u@=qkGS?%Lo*T|3y|n@M4T)!px}cfap>GEe57IWuR@ocT?;=gx$J zAP5`8KoA2!TtJHxCJ{24{{kApPe_JTCY(>u{29Kur-v&oIWA5{$Z7sGoaRa+(g?mn z&WlX~<#MTlShQ$S?T2R_1_*+Z5hQ~I^qGS=M-M@A5DcUcq(6wTJuWwl8N`~&3J-<3 zJpI^0{|3yr=N8hwzbXwqLITrOWGmkP!4n!?`t(x~eGT4~B5 z-#zrO6%=r}3UR7XEZ_>oamgya=Xexo^o41ZK)$z*?)tf0B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