Skip to content

Commit

Permalink
test: test process.setuid for bad argument types
Browse files Browse the repository at this point in the history
Test process.setuid with an object as an argument. An equivalent test
exists for process.seteuid.

PR-URL: #19703
Fixes: #19591
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
dsinecos authored and lpinca committed Apr 4, 2018
1 parent 8271215 commit 83444b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-process-setuid-setgid.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ if (common.isWindows) {
return;
}

assert.throws(() => {
process.setuid({});
}, /^TypeError: setuid argument must be a number or a string$/);

assert.throws(() => {
process.setuid('fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf');
}, /^Error: setuid user id does not exist$/);
Expand Down

0 comments on commit 83444b7

Please sign in to comment.