test: fix bug in setproctitle test

Output from `ps` may contain trailing whitespace, trim it.
This commit is contained in:
Ben Noordhuis
2011-10-15 02:05:33 +02:00
parent 4908e5bf7a
commit 2f8596ee10

View File

@@ -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);
});