summaryrefslogtreecommitdiff
path: root/test/parallel/test-module-loading-error.js
diff options
context:
space:
mode:
authorfansworld-claudio <cr@fansworld.tv>2015-11-16 10:59:39 -0300
committerEvan Lucas <evanlucas@me.com>2015-11-18 08:01:13 -0600
commit9a628e2dac75655e4876ba56eb4cf35d444db54a (patch)
tree9adb2510714a3fe253dbd6aef3a37b142833d07a /test/parallel/test-module-loading-error.js
parent29cd1195ec35831241d7db7db3749db280a9b1c6 (diff)
downloadnode-new-9a628e2dac75655e4876ba56eb4cf35d444db54a.tar.gz
test: module loading error fix solaris #3798
- refactor test to accept multiple error messages per platform - add new message to be found in Solaris 11.3 as per #3798 PR-URL: https://github.com/nodejs/node/pull/3855 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'test/parallel/test-module-loading-error.js')
-rw-r--r--test/parallel/test-module-loading-error.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js
index f2581a4df5..5f9195d773 100644
--- a/test/parallel/test-module-loading-error.js
+++ b/test/parallel/test-module-loading-error.js
@@ -5,12 +5,10 @@ var assert = require('assert');
console.error('load test-module-loading-error.js');
var error_desc = {
- win32: '%1 is not a valid Win32 application',
- linux: 'file too short',
- sunos: 'unknown file type'
+ win32: ['%1 is not a valid Win32 application'],
+ linux: ['file too short', 'Exec format error'],
+ sunos: ['unknown file type', 'not an ELF file']
};
-var musl_errno_enoexec = 'Exec format error';
-
var dlerror_msg = error_desc[process.platform];
if (!dlerror_msg) {
@@ -21,11 +19,9 @@ if (!dlerror_msg) {
try {
require('../fixtures/module-loading-error.node');
} catch (e) {
- if (process.platform === 'linux' &&
- e.toString().indexOf(musl_errno_enoexec) !== -1) {
- dlerror_msg = musl_errno_enoexec;
- }
- assert.notEqual(e.toString().indexOf(dlerror_msg), -1);
+ assert.strictEqual(dlerror_msg.some((errMsgCase) => {
+ return e.toString().indexOf(errMsgCase) !== -1;
+ }), true);
}
try {