@@ -176,6 +176,17 @@ function testFile(engine, file, filename, index) {
176
176
177
177
l = html . length ;
178
178
179
+ if ( l === 0 && text . length > 0 ) {
180
+ text = text . substring ( 0 , Math . min ( 30 , text . length ) ) ;
181
+
182
+ console . log ( ' failed in %dms at offset %d. Near: "%s".\n' , prettyElapsedTime ( elapsed ) , 0 , text ) ;
183
+
184
+ console . log ( '\nActual:\n%s\n' , text . trim ( ) || text ) ;
185
+ console . log ( '\nExpected:\n\n' ) ;
186
+
187
+ return false ;
188
+ }
189
+
179
190
for ( j = 0 ; j < l ; j ++ ) {
180
191
if ( text [ j ] !== html [ j ] ) {
181
192
text = text . substring (
@@ -188,7 +199,7 @@ function testFile(engine, file, filename, index) {
188
199
189
200
console . log ( ' failed in %dms at offset %d. Near: "%s".\n' , prettyElapsedTime ( elapsed ) , j , text ) ;
190
201
191
- console . log ( '\nGot :\n%s\n' , text . trim ( ) || text ) ;
202
+ console . log ( '\nActual :\n%s\n' , text . trim ( ) || text ) ;
192
203
console . log ( '\nExpected:\n%s\n' , html . trim ( ) || html ) ;
193
204
194
205
return false ;
@@ -346,11 +357,11 @@ function time(options) {
346
357
*/
347
358
348
359
function fix ( ) {
349
- [ 'compiled_tests' , 'original' , 'new' ] . forEach ( function ( dir ) {
360
+ [ 'compiled_tests' , 'original' , 'new' , 'redos' ] . forEach ( function ( dir ) {
350
361
try {
351
362
fs . mkdirSync ( path . resolve ( __dirname , dir ) ) ;
352
363
} catch ( e ) {
353
- ;
364
+ // directory already exists
354
365
}
355
366
} ) ;
356
367
@@ -435,6 +446,12 @@ function fix() {
435
446
fs . writeFileSync ( path . resolve ( __dirname , 'compiled_tests' , file ) ,
436
447
fs . readFileSync ( path . resolve ( __dirname , 'new' , file ) ) ) ;
437
448
} ) ;
449
+
450
+ // cp redos/* tests/
451
+ fs . readdirSync ( path . resolve ( __dirname , 'redos' ) ) . forEach ( function ( file ) {
452
+ fs . writeFileSync ( path . resolve ( __dirname , 'compiled_tests' , file ) ,
453
+ fs . readFileSync ( path . resolve ( __dirname , 'redos' , file ) ) ) ;
454
+ } ) ;
438
455
}
439
456
440
457
/**
0 commit comments