From 2f8596ee107261f12fc226fc70c0bcc4da535f44 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 15 Oct 2011 02:05:33 +0200 Subject: [PATCH] test: fix bug in setproctitle test Output from `ps` may contain trailing whitespace, trim it. --- test/simple/test-setproctitle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/simple/test-setproctitle.js b/test/simple/test-setproctitle.js index 47635be1cd9..4276d2d3663 100644 --- a/test/simple/test-setproctitle.js +++ b/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); });