Fixed the regexp for removing full paths

This commit is contained in:
Bill Ticehurst
2016-06-27 01:23:22 -07:00
parent 1b43bd8e83
commit de559fb3f4
37 changed files with 53 additions and 59 deletions
+3 -9
View File
@@ -31,18 +31,12 @@ abstract class RunnerBase {
/** Replaces instances of full paths with fileNames only */
static removeFullPaths(path: string) {
let fixedPath = path;
// full paths either start with a drive letter or / for *nix, shouldn't have \ in the path at this point
const fullPath = /(\w+:|\/)?([\w+\-\.]|\/)*\.tsx?/g;
const fullPathList = fixedPath.match(fullPath);
if (fullPathList) {
fullPathList.forEach((match: string) => fixedPath = fixedPath.replace(match, Harness.Path.getFileName(match)));
}
// If its a full path (starts with "C:" or "/") replace with just the filename
let fixedPath = /^(\w:|\/)/.test(path) ? Harness.Path.getFileName(path) : path;
// when running in the browser the 'full path' is the host name, shows up in error baselines
const localHost = /http:\/localhost:\d+/g;
fixedPath = fixedPath.replace(localHost, "");
return fixedPath;
}
}
}
@@ -4,5 +4,5 @@ tests/cases/compiler/declarationEmit_invalidReference2.ts(1,1): error TS6053: Fi
==== tests/cases/compiler/declarationEmit_invalidReference2.ts (1 errors) ====
/// <reference path="invalid.ts" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'invalid.ts' not found.
!!! error TS6053: File 'tests/cases/compiler/invalid.ts' not found.
var x = 0;
@@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.d.ts (0 errors) ====
declare class c {
@@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'out.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
==== tests/cases/compiler/out.d.ts (0 errors) ====
declare class c {
@@ -14,7 +14,7 @@ tests/cases/compiler/exportStarFromEmptyModule_module4.ts(4,5): error TS2339: Pr
==== tests/cases/compiler/exportStarFromEmptyModule_module3.ts (1 errors) ====
export * from "./exportStarFromEmptyModule_module2";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not a module.
!!! error TS2306: File 'tests/cases/compiler/exportStarFromEmptyModule_module2.ts' is not a module.
export * from "./exportStarFromEmptyModule_module1";
export class A {
@@ -4,7 +4,7 @@ tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2306: File 'test
==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ====
import foo = require("./foo_0");
~~~~~~~~~
!!! error TS2306: File 'foo_0.ts' is not a module.
!!! error TS2306: File 'tests/cases/conformance/externalModules/foo_0.ts' is not a module.
// Import should fail. foo_0 not an external module
if(foo.answer === 42){
@@ -5,10 +5,10 @@ tests/cases/compiler/invalidTripleSlashReference.ts(2,1): error TS6053: File 'te
==== tests/cases/compiler/invalidTripleSlashReference.ts (2 errors) ====
/// <reference path='filedoesnotexist.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'filedoesnotexist.ts' not found.
!!! error TS6053: File 'tests/cases/compiler/filedoesnotexist.ts' not found.
/// <reference path='otherdoesnotexist.d.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'otherdoesnotexist.d.ts' not found.
!!! error TS6053: File 'tests/cases/compiler/otherdoesnotexist.d.ts' not found.
// this test doesn't actually give the errors you want due to the way the compiler reports errors
var x = 1;
@@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
@@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'b.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
@@ -18,7 +18,7 @@
==== /node_modules/bar/index.d.ts (1 errors) ====
/// <reference types="alpha" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! message TS4090: Conflicting library definitions for 'alpha' found at 'index.d.ts' and 'index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict.
!!! message TS4090: Conflicting library definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict.
declare var bar: any;
==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ====
@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts(4,1): error TS60
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export module CompilerDiagnostics {
@@ -348,7 +348,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export enum TokenID {
@@ -523,7 +523,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export class ASTSpan {
@@ -215,7 +215,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource12.ts(524,30): error
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export interface IAstWalker {
@@ -122,7 +122,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(135,36): error
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript.AstWalkerWithDetailCallback {
export interface AstWalkerDetailCallback {
@@ -166,7 +166,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export function lastOf(items: any[]): any {
@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource2.ts(4,1): error TS60
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource3.ts(4,1): error TS60
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
// Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback
@@ -8,7 +8,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error T
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
@@ -16,7 +16,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts(61,65): error TS
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
// TODO: refactor indent logic for use in emit
@@ -67,7 +67,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource6.ts(215,20): error T
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export class TypeCollectionContext {
@@ -309,7 +309,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export class Continuation {
@@ -140,7 +140,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(454,35): error T
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
@@ -39,7 +39,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export class Binder {
@@ -128,16 +128,16 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32):
///<reference path='..\compiler\io.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'io.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/compiler/io.ts' not found.
///<reference path='..\compiler\typescript.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescript.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/compiler/typescript.ts' not found.
///<reference path='..\services\typescriptServices.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'typescriptServices.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/services/typescriptServices.ts' not found.
///<reference path='diff.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'diff.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/diff.ts' not found.
declare var assert: Harness.Assert;
~~~~~~
@@ -146,7 +146,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38):
///<reference path='formatting.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'formatting.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/formatting.ts' not found.
module Formatting {
@@ -1,7 +1,7 @@
importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -10,7 +10,7 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -22,7 +22,7 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type
exports.f2 = m2;
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/node_modules/m3/index.js (0 errors) ====
==== index.js (0 errors) ====
exports.person = {
"name": "John Doe",
"age": 42
@@ -1,7 +1,7 @@
importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -10,7 +10,7 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -22,7 +22,7 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type
exports.f2 = m2;
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/node_modules/m3/index.js (0 errors) ====
==== index.js (0 errors) ====
exports.person = {
"name": "John Doe",
"age": 42
@@ -1,7 +1,7 @@
maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -10,7 +10,7 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -1,7 +1,7 @@
maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -10,7 +10,7 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -1,13 +1,13 @@
maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/node_modules/m3/index.js (0 errors) ====
==== index.js (0 errors) ====
exports.person = {
"name": "John Doe",
"age": 42
}
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -16,7 +16,7 @@ maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -1,13 +1,13 @@
maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/node_modules/m3/index.js (0 errors) ====
==== index.js (0 errors) ====
exports.person = {
"name": "John Doe",
"age": 42
}
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/entry.js (0 errors) ====
==== entry.js (0 errors) ====
var m3 = require("m3");
module.exports = {
@@ -16,7 +16,7 @@ maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m1/index.js (0 errors) ====
==== index.js (0 errors) ====
var m2 = require('m2');
/**
@@ -1,7 +1,7 @@
error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
!!! error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
class C {
}
@@ -1,7 +1,7 @@
error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
!!! error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
class C {
}
@@ -6,7 +6,7 @@ tests/cases/compiler/requireOfAnEmptyFile1_a.ts(3,21): error TS2306: File 'tests
import fs = require('./requireOfAnEmptyFile1_b');
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2306: File 'requireOfAnEmptyFile1_b.ts' is not a module.
!!! error TS2306: File 'tests/cases/compiler/requireOfAnEmptyFile1_b.ts' is not a module.
==== tests/cases/compiler/requireOfAnEmptyFile1_b.ts (0 errors) ====
@@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304
==== tests/cases/conformance/scanner/ecmascript5/scannertest1.ts (16 errors) ====
///<reference path='References.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'References.ts' not found.
!!! error TS6053: File 'tests/cases/conformance/scanner/ecmascript5/References.ts' not found.
class CharacterInfo {
public static isDecimalDigit(c: number): boolean {
@@ -4,7 +4,7 @@ tests/cases/compiler/selfReferencingFile2.ts(1,1): error TS6053: File 'tests/cas
==== tests/cases/compiler/selfReferencingFile2.ts (1 errors) ====
///<reference path='../selfReferencingFile2.ts'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'selfReferencingFile2.ts' not found.
!!! error TS6053: File 'tests/cases/selfReferencingFile2.ts' not found.
class selfReferencingFile2 {