Browse Source

test: fix bug in setproctitle test

Output from `ps` may contain trailing whitespace, trim it.
v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
2f8596ee10
  1. 4
      test/simple/test-setproctitle.js

4
test/simple/test-setproctitle.js

@ -39,6 +39,6 @@ assert.equal(process.title, title);
exec('ps -p ' + process.pid + ' -o args=', function(error, stdout, stderr) {
assert.equal(error, null);
assert.equal(stderr, '');
// omitting trailing \n
assert.equal(stdout.substring(0, stdout.length - 1), title);
// omitting trailing whitespace and \n
assert.equal(stdout.replace(/\s+$/, ''), title);
});

Loading…
Cancel
Save