projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4908e5b
)
test: fix bug in setproctitle test
author
Ben Noordhuis
<info@bnoordhuis.nl>
Sat, 15 Oct 2011 00:05:33 +0000
(
02:05
+0200)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Sat, 15 Oct 2011 00:07:57 +0000
(
02:07
+0200)
Output from `ps` may contain trailing whitespace, trim it.
test/simple/test-setproctitle.js
patch
|
blob
|
history
diff --git
a/test/simple/test-setproctitle.js
b/test/simple/test-setproctitle.js
index 47635be1cd9a33c548ab1108cd55f515499d5fa7..4276d2d3663285a491e60b005cdff3ebd41f963b 100644
(file)
--- 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);
});