Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9a628e2

Browse filesBrowse files
fansworld-claudioevanlucas
authored andcommitted
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: #3855 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
1 parent 29cd119 commit 9a628e2
Copy full SHA for 9a628e2

File tree

Expand file treeCollapse file tree

1 file changed

+6
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-10
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-module-loading-error.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-module-loading-error.js
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ var assert = require('assert');
55
console.error('load test-module-loading-error.js');
66

77
var error_desc = {
8-
win32: '%1 is not a valid Win32 application',
9-
linux: 'file too short',
10-
sunos: 'unknown file type'
8+
win32: ['%1 is not a valid Win32 application'],
9+
linux: ['file too short', 'Exec format error'],
10+
sunos: ['unknown file type', 'not an ELF file']
1111
};
12-
var musl_errno_enoexec = 'Exec format error';
13-
1412
var dlerror_msg = error_desc[process.platform];
1513

1614
if (!dlerror_msg) {
@@ -21,11 +19,9 @@ if (!dlerror_msg) {
2119
try {
2220
require('../fixtures/module-loading-error.node');
2321
} catch (e) {
24-
if (process.platform === 'linux' &&
25-
e.toString().indexOf(musl_errno_enoexec) !== -1) {
26-
dlerror_msg = musl_errno_enoexec;
27-
}
28-
assert.notEqual(e.toString().indexOf(dlerror_msg), -1);
22+
assert.strictEqual(dlerror_msg.some((errMsgCase) => {
23+
return e.toString().indexOf(errMsgCase) !== -1;
24+
}), true);
2925
}
3026

3127
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.