| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce423f3 commit f99c636
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,12 +5,10 @@ var assert = require('assert'); | |||
| 5 | 5 | console.error('load test-module-loading-error.js'); | |
| 6 | 6 | ||
| 7 | 7 | 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'] | ||
| 11 | 11 | }; | |
| 12 | - var musl_errno_enoexec = 'Exec format error'; | ||
| 13 | - | ||
| 14 | 12 | var dlerror_msg = error_desc[process.platform]; | |
| 15 | 13 | ||
| 16 | 14 | if (!dlerror_msg) { | |
@@ -21,11 +19,9 @@ if (!dlerror_msg) { | |||
| 21 | 19 | try { | |
| 22 | 20 | require('../fixtures/module-loading-error.node'); | |
| 23 | 21 | } 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); | ||
| 29 | 25 | } | |
| 30 | 26 | ||
| 31 | 27 | try { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments