Skip to content

Commit

Permalink
Add test for mac pts name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Mar 30, 2017
1 parent 3c8fe6a commit f850c19
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/unixTerminal.test.js
Expand Up @@ -7,8 +7,16 @@ describe("UnixTerminal", function() {
describe("Constructor", function() {
it("should set a valid pts name", function() {
const term = new UnixTerminal('cmd.exe', [], {});
// Should match form from https://linux.die.net/man/4/pts
assert.ok(/^\/dev\/pts\/\d+$/.test(term.pty));

if (process.platform === 'linux') {
// https://linux.die.net/man/4/pts
assert.ok(/^\/dev\/pts\/\d+$/.test(term.pty));
}

if (process.platform === 'mac') {
// https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man4/pty.4.html
assert.ok(/^\/dev\/tty[p-sP-S][a-z0-9]$/.test(term.pty));
}
});
});
});

0 comments on commit f850c19

Please sign in to comment.