@@ -38,26 +38,24 @@ const resolveTests = [
38
38
]
39
39
]
40
40
] ;
41
- resolveTests . forEach ( ( test ) => {
42
- const resolve = test [ 0 ] ;
43
- test [ 1 ] . forEach ( ( test ) => {
44
- const actual = resolve . apply ( null , test [ 0 ] ) ;
41
+ resolveTests . forEach ( ( [ resolve , tests ] ) => {
42
+ tests . forEach ( ( [ test , expected ] ) => {
43
+ const actual = resolve . apply ( null , test ) ;
45
44
let actualAlt ;
46
45
const os = resolve === path . win32 . resolve ? 'win32' : 'posix' ;
47
46
if ( resolve === path . win32 . resolve && ! common . isWindows )
48
47
actualAlt = actual . replace ( backslashRE , '/' ) ;
49
48
else if ( resolve !== path . win32 . resolve && common . isWindows )
50
49
actualAlt = actual . replace ( slashRE , '\\' ) ;
51
50
52
- const expected = test [ 1 ] ;
53
51
const message =
54
- `path.${ os } .resolve(${ test [ 0 ] . map ( JSON . stringify ) . join ( ',' ) } )\n expect=${
52
+ `path.${ os } .resolve(${ test . map ( JSON . stringify ) . join ( ',' ) } )\n expect=${
55
53
JSON . stringify ( expected ) } \n actual=${ JSON . stringify ( actual ) } `;
56
54
if ( actual !== expected && actualAlt !== expected )
57
- failures . push ( `\n ${ message } ` ) ;
55
+ failures . push ( message ) ;
58
56
} ) ;
59
57
} ) ;
60
- assert . strictEqual ( failures . length , 0 , failures . join ( '' ) ) ;
58
+ assert . strictEqual ( failures . length , 0 , failures . join ( '\n ' ) ) ;
61
59
62
60
if ( common . isWindows ) {
63
61
// Test resolving the current Windows drive letter from a spawned process.
0 commit comments