@@ -40,6 +40,10 @@ class CompilerBaselineRunner extends RunnerBase {
4040 this . basePath += "/" + this . testSuiteName ;
4141 }
4242
43+ private makeUnitName ( name : string , root : string ) {
44+ return ts . isRootedDiskPath ( name ) ? name : ( root + name ) ;
45+ } ;
46+
4347 public checkTestCodeOutput ( fileName : string ) {
4448 describe ( "compiler tests for " + fileName , ( ) => {
4549 // Mocha holds onto the closure environment of the describe callback even after the test is done.
@@ -74,16 +78,16 @@ class CompilerBaselineRunner extends RunnerBase {
7478 toBeCompiled = [ ] ;
7579 otherFiles = [ ] ;
7680 if ( / r e q u i r e \( / . test ( lastUnit . content ) || / r e f e r e n c e \s p a t h / . test ( lastUnit . content ) ) {
77- toBeCompiled . push ( { unitName : ts . isRootedDiskPath ( lastUnit . name ) ? lastUnit . name : rootDir + lastUnit . name , content : lastUnit . content } ) ;
81+ toBeCompiled . push ( { unitName : this . makeUnitName ( lastUnit . name , rootDir ) , content : lastUnit . content } ) ;
7882 units . forEach ( unit => {
7983 if ( unit . name !== lastUnit . name ) {
80- otherFiles . push ( { unitName : ts . isRootedDiskPath ( unit . name ) ? unit . name : rootDir + unit . name , content : unit . content } ) ;
84+ otherFiles . push ( { unitName : this . makeUnitName ( unit . name , rootDir ) , content : unit . content } ) ;
8185 }
8286 } ) ;
8387 }
8488 else {
8589 toBeCompiled = units . map ( unit => {
86- return { unitName : ts . isRootedDiskPath ( unit . name ) ? unit . name : rootDir + unit . name , content : unit . content } ;
90+ return { unitName : this . makeUnitName ( unit . name , rootDir ) , content : unit . content } ;
8791 } ) ;
8892 }
8993
0 commit comments