Skip to content

Commit 6c392a2

Browse files
committed
Add test for setpgid
1 parent fc44349 commit 6c392a2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/unit/test-setpgid.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var assert = require('assert'),
2+
posix = require("../../lib/posix");
3+
4+
assert.throws(function () {
5+
posix.setpgid()
6+
}, /exactly two arguments/)
7+
8+
assert.throws(function () {
9+
posix.setpgid('a', 1)
10+
}, /must be an integer/)
11+
12+
assert.throws(function () {
13+
posix.setpgid(1, 'a')
14+
}, /must be an integer/)
15+
16+
var old = posix.getpgid(0);
17+
assert.ok(old !== process.id);
18+
19+
posix.setpgid(0, process.pid);
20+
assert.equal(posix.getpgid(0), process.pid);

0 commit comments

Comments
 (0)