Skip to content

Commit

Permalink
test: increase specificity in dgram test
Browse files Browse the repository at this point in the history
Expand error message checking to include the entire error string in
test-dgram-membership.

PR-URL: #11187
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and jasnell committed Mar 7, 2017
1 parent b47b8f5 commit 888ca4a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-dgram-membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true});
const socket = setup();
socket.close(common.mustCall(() => {
assert.throws(() => { socket.addMembership(multicastAddress); },
/Not running/);
/^Error: Not running$/);
}));
}

Expand All @@ -21,23 +21,23 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true});
const socket = setup();
socket.close(common.mustCall(() => {
assert.throws(() => { socket.dropMembership(multicastAddress); },
/Not running/);
/^Error: Not running$/);
}));
}

// addMembership() with no argument should throw
{
const socket = setup();
assert.throws(() => { socket.addMembership(); },
/multicast address must be specified/);
/^Error: multicast address must be specified$/);
socket.close();
}

// dropMembership() with no argument should throw
{
const socket = setup();
assert.throws(() => { socket.dropMembership(); },
/multicast address must be specified/);
/^Error: multicast address must be specified$/);
socket.close();
}

Expand Down Expand Up @@ -69,7 +69,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true});
const socket = setup();
assert.throws(
() => { socket.dropMembership(multicastAddress); },
/EADDRNOTAVAIL/
/^Error: dropMembership EADDRNOTAVAIL$/
);
socket.close();
}
Expand Down

0 comments on commit 888ca4a

Please sign in to comment.