Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: adding exception for EINVAL on SmartOS
  • Loading branch information
Trott committed Dec 26, 2016
commit 04fb7e108e6fa0a6d55df2a2c6a8fa11eeda25a6
18 changes: 15 additions & 3 deletions test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
'use strict';
require('../common');
const common = require('../common');

// if printing, add to out file
const originalRefreshSizeWrapperStderr = process.stderr._refreshSize;
const originalRefreshSizeWrapperStdout = process.stdout._refreshSize;

const refreshSizeWrapperStderr = () => {
console.log('calling stderr._refreshSize');
originalRefreshSizeWrapperStderr.call(process.stderr);
try {
originalRefreshSizeWrapperStderr.call(process.stderr);
} catch (e) {
// EINVAL happens on SmartOS if emulation is incomplete
if (!common.isSunOS || e.code !== 'EINVAL')
throw e;
}
};

const refreshSizeWrapperStdout = () => {
console.log('calling stdout._refreshSize');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment indicating that the console.log is part of the test would be helpful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done. Will run Ci again because there was some refactoring that accompanied it.

originalRefreshSizeWrapperStdout.call(process.stdout);
try {
originalRefreshSizeWrapperStdout.call(process.stdout);
} catch (e) {
// EINVAL happens on SmartOS if emulation is incomplete
if (!common.isSunOS || e.code !== 'EINVAL')
throw e;
}
};

process.stderr._refreshSize = refreshSizeWrapperStderr;
Expand Down