From b7d2e971215750911e225ea385f1f7a3c161a898 Mon Sep 17 00:00:00 2001 From: gucong Date: Sun, 30 Sep 2018 19:32:20 +0800 Subject: [PATCH] shebang path space --- appveyor.yml | 36 ++++++++++++++++++------------------ test/basic.js | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 026d49e..94d5c03 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,18 +1,18 @@ -environment: - matrix: - - nodejs_version: '8' - - nodejs_version: '6' - - nodejs_version: '4' -install: - - ps: Install-Product node $env:nodejs_version - - npm -g install npm@latest - - set PATH=%APPDATA%\npm;%PATH% - - npm install -matrix: - fast_finish: true -build: off -version: '{build}' -shallow_clone: true -clone_depth: 1 -test_script: - - npm test +environment: + matrix: + - nodejs_version: '8' + - nodejs_version: '6' + - nodejs_version: '4' +install: + - ps: Install-Product node $env:nodejs_version + - npm -g install npm@lts + - set PATH=%APPDATA%\npm;%PATH% + - npm install +matrix: + fast_finish: true +build: off +version: '{build}' +shallow_clone: true +clone_depth: 1 +test_script: + - npm test diff --git a/test/basic.js b/test/basic.js index 42508a7..f262c95 100644 --- a/test/basic.js +++ b/test/basic.js @@ -23,7 +23,7 @@ if (process.argv[2] === 'parent') { console.log('EXIT %j', [code, signal]) }) var argv = process.argv.slice(3).map(function (arg) { - if (arg === fixture) { + if (path.resolve(arg) === fixture) { return '{{FIXTURE}}' } return arg @@ -271,6 +271,20 @@ t.test('exec execPath', function (t) { }) }) +t.test('windows shebang', function (t) { + var child = cp.spawn('env', [fixture, 'xyz']) + var out = '' + child.stdout.on('data', function (c) { + out += c + }) + child.on('close', function (code, signal) { + t.equal(code, 0) + t.equal(signal, null) + t.equal(out, expect) + t.end() + }) +}) + t.test('exec shebang', { skip: winNoShebang }, function (t) { t.plan(3)