mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: fix bug in setproctitle test
Output from `ps` may contain trailing whitespace, trim it.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user