Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-process-kill-null.js « simple « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d45ea9f9f711ccca016a7104cd11440e169e8679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

var assert = require('assert');
var spawn = require('child_process').spawn;

var cat = spawn('cat');
var called;

process.kill(cat.pid, 0);

cat.stdout.on('data', function(){
  called = true;
  process.kill(cat.pid, 'SIGKILL');
});

// EPIPE when null sig fails
cat.stdin.write('test');

process.on('exit', function(){
  assert.ok(called);
});