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