From 4d173ea7d6f7f656f2c6868651192be0d1c312b9 Mon Sep 17 00:00:00 2001 From: Xu Meng Date: Wed, 18 Mar 2020 00:12:26 -0500 Subject: [PATCH] test: uv_tty_init returns EBADF on IBM i When TTY initialization failed, uv_tty_init returned EBADF on IBM i PASE, rather than EINVAL PR-URL: https://github.com/nodejs/node/pull/32338 Reviewed-By: Ben Noordhuis Reviewed-By: Beth Griggs Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- test/parallel/test-ttywrap-invalid-fd.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-ttywrap-invalid-fd.js b/test/parallel/test-ttywrap-invalid-fd.js index ea2e0f276dbf9a..5539ff22962244 100644 --- a/test/parallel/test-ttywrap-invalid-fd.js +++ b/test/parallel/test-ttywrap-invalid-fd.js @@ -21,13 +21,14 @@ assert.throws( { const info = { - code: common.isWindows ? 'EBADF' : 'EINVAL', - message: common.isWindows ? 'bad file descriptor' : 'invalid argument', - errno: common.isWindows ? UV_EBADF : UV_EINVAL, + code: common.isWindows || common.isIBMi ? 'EBADF' : 'EINVAL', + message: common.isWindows || + common.isIBMi ? 'bad file descriptor' : 'invalid argument', + errno: common.isWindows || common.isIBMi ? UV_EBADF : UV_EINVAL, syscall: 'uv_tty_init' }; - const suffix = common.isWindows ? + const suffix = common.isWindows || common.isIBMi ? 'EBADF (bad file descriptor)' : 'EINVAL (invalid argument)'; const message = `TTY initialization failed: uv_tty_init returned ${suffix}`;