diff --git a/src/testRunner/runner.ts b/src/testRunner/runner.ts index 3c1a7c5633340..0c5561332d656 100644 --- a/src/testRunner/runner.ts +++ b/src/testRunner/runner.ts @@ -6,9 +6,26 @@ namespace Harness { function runTests(runners: RunnerBase[]) { for (let i = iterations; i > 0; i--) { + const seen = new Map(); + const dupes: [string, string][] = []; for (const runner of runners) { + for (const sf of runner.enumerateTestFiles()) { + const full = typeof sf === "string" ? sf : sf.file; + const base = vpath.basename(full).toLowerCase(); + // exempt fourslash-fourslash conflicts since they're less likely to emit baselines + if (seen.has(base) && !(/fourslash/.test(seen.get(base)!) && /fourslash/.test(full))) { + dupes.push([seen.get(base)!, full]); + } + else { + seen.set(base, full); + } + } runner.initializeTests(); } + if (dupes.length) { + throw new Error(`${dupes.length} Tests with duplicate baseline names: +${JSON.stringify(dupes, undefined, 2)}`); + } } } diff --git a/tests/baselines/reference/abstractProperty.symbols b/tests/baselines/reference/abstractProperty.symbols deleted file mode 100644 index 3c69af4ffe938..0000000000000 --- a/tests/baselines/reference/abstractProperty.symbols +++ /dev/null @@ -1,59 +0,0 @@ -=== tests/cases/compiler/abstractProperty.ts === -interface A { ->A : Symbol(A, Decl(abstractProperty.ts, 0, 0)) - - prop: string; ->prop : Symbol(A.prop, Decl(abstractProperty.ts, 0, 13)) - - raw: string; ->raw : Symbol(A.raw, Decl(abstractProperty.ts, 1, 17)) - - m(): void; ->m : Symbol(A.m, Decl(abstractProperty.ts, 2, 16)) -} -abstract class B implements A { ->B : Symbol(B, Decl(abstractProperty.ts, 4, 1)) ->A : Symbol(A, Decl(abstractProperty.ts, 0, 0)) - - abstract prop: string; ->prop : Symbol(B.prop, Decl(abstractProperty.ts, 5, 31)) - - abstract raw: string; ->raw : Symbol(B.raw, Decl(abstractProperty.ts, 6, 26)) - - abstract readonly ro: string; ->ro : Symbol(B.ro, Decl(abstractProperty.ts, 7, 25)) - - abstract get readonlyProp(): string; ->readonlyProp : Symbol(B.readonlyProp, Decl(abstractProperty.ts, 8, 33), Decl(abstractProperty.ts, 9, 40)) - - abstract set readonlyProp(val: string); ->readonlyProp : Symbol(B.readonlyProp, Decl(abstractProperty.ts, 8, 33), Decl(abstractProperty.ts, 9, 40)) ->val : Symbol(val, Decl(abstractProperty.ts, 10, 30)) - - abstract m(): void; ->m : Symbol(B.m, Decl(abstractProperty.ts, 10, 43)) -} -class C extends B { ->C : Symbol(C, Decl(abstractProperty.ts, 12, 1)) ->B : Symbol(B, Decl(abstractProperty.ts, 4, 1)) - - get prop() { return "foo"; } ->prop : Symbol(C.prop, Decl(abstractProperty.ts, 13, 19), Decl(abstractProperty.ts, 14, 32)) - - set prop(v) { } ->prop : Symbol(C.prop, Decl(abstractProperty.ts, 13, 19), Decl(abstractProperty.ts, 14, 32)) ->v : Symbol(v, Decl(abstractProperty.ts, 15, 13)) - - raw = "edge"; ->raw : Symbol(C.raw, Decl(abstractProperty.ts, 15, 19)) - - readonly ro = "readonly please"; ->ro : Symbol(C.ro, Decl(abstractProperty.ts, 16, 17)) - - readonlyProp: string; // don't have to give a value, in fact ->readonlyProp : Symbol(C.readonlyProp, Decl(abstractProperty.ts, 17, 36)) - - m() { } ->m : Symbol(C.m, Decl(abstractProperty.ts, 18, 25)) -} diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractPropertyBasics.js similarity index 94% rename from tests/baselines/reference/abstractProperty.js rename to tests/baselines/reference/abstractPropertyBasics.js index bfa80a63061ca..b2010c3538162 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractPropertyBasics.js @@ -1,4 +1,4 @@ -//// [abstractProperty.ts] +//// [abstractPropertyBasics.ts] interface A { prop: string; raw: string; @@ -21,7 +21,7 @@ class C extends B { m() { } } -//// [abstractProperty.js] +//// [abstractPropertyBasics.js] var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/abstractPropertyBasics.symbols b/tests/baselines/reference/abstractPropertyBasics.symbols new file mode 100644 index 0000000000000..4d7cd333a96c3 --- /dev/null +++ b/tests/baselines/reference/abstractPropertyBasics.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/abstractPropertyBasics.ts === +interface A { +>A : Symbol(A, Decl(abstractPropertyBasics.ts, 0, 0)) + + prop: string; +>prop : Symbol(A.prop, Decl(abstractPropertyBasics.ts, 0, 13)) + + raw: string; +>raw : Symbol(A.raw, Decl(abstractPropertyBasics.ts, 1, 17)) + + m(): void; +>m : Symbol(A.m, Decl(abstractPropertyBasics.ts, 2, 16)) +} +abstract class B implements A { +>B : Symbol(B, Decl(abstractPropertyBasics.ts, 4, 1)) +>A : Symbol(A, Decl(abstractPropertyBasics.ts, 0, 0)) + + abstract prop: string; +>prop : Symbol(B.prop, Decl(abstractPropertyBasics.ts, 5, 31)) + + abstract raw: string; +>raw : Symbol(B.raw, Decl(abstractPropertyBasics.ts, 6, 26)) + + abstract readonly ro: string; +>ro : Symbol(B.ro, Decl(abstractPropertyBasics.ts, 7, 25)) + + abstract get readonlyProp(): string; +>readonlyProp : Symbol(B.readonlyProp, Decl(abstractPropertyBasics.ts, 8, 33), Decl(abstractPropertyBasics.ts, 9, 40)) + + abstract set readonlyProp(val: string); +>readonlyProp : Symbol(B.readonlyProp, Decl(abstractPropertyBasics.ts, 8, 33), Decl(abstractPropertyBasics.ts, 9, 40)) +>val : Symbol(val, Decl(abstractPropertyBasics.ts, 10, 30)) + + abstract m(): void; +>m : Symbol(B.m, Decl(abstractPropertyBasics.ts, 10, 43)) +} +class C extends B { +>C : Symbol(C, Decl(abstractPropertyBasics.ts, 12, 1)) +>B : Symbol(B, Decl(abstractPropertyBasics.ts, 4, 1)) + + get prop() { return "foo"; } +>prop : Symbol(C.prop, Decl(abstractPropertyBasics.ts, 13, 19), Decl(abstractPropertyBasics.ts, 14, 32)) + + set prop(v) { } +>prop : Symbol(C.prop, Decl(abstractPropertyBasics.ts, 13, 19), Decl(abstractPropertyBasics.ts, 14, 32)) +>v : Symbol(v, Decl(abstractPropertyBasics.ts, 15, 13)) + + raw = "edge"; +>raw : Symbol(C.raw, Decl(abstractPropertyBasics.ts, 15, 19)) + + readonly ro = "readonly please"; +>ro : Symbol(C.ro, Decl(abstractPropertyBasics.ts, 16, 17)) + + readonlyProp: string; // don't have to give a value, in fact +>readonlyProp : Symbol(C.readonlyProp, Decl(abstractPropertyBasics.ts, 17, 36)) + + m() { } +>m : Symbol(C.m, Decl(abstractPropertyBasics.ts, 18, 25)) +} diff --git a/tests/baselines/reference/abstractProperty.types b/tests/baselines/reference/abstractPropertyBasics.types similarity index 88% rename from tests/baselines/reference/abstractProperty.types rename to tests/baselines/reference/abstractPropertyBasics.types index d26af73b9aa7c..123e4041941f6 100644 --- a/tests/baselines/reference/abstractProperty.types +++ b/tests/baselines/reference/abstractPropertyBasics.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/abstractProperty.ts === +=== tests/cases/compiler/abstractPropertyBasics.ts === interface A { prop: string; >prop : string diff --git a/tests/cases/compiler/abstractProperty.ts b/tests/cases/compiler/abstractPropertyBasics.ts similarity index 100% rename from tests/cases/compiler/abstractProperty.ts rename to tests/cases/compiler/abstractPropertyBasics.ts diff --git a/tests/cases/fourslash/augmentedTypesClass3.ts b/tests/cases/fourslash/augmentedTypesClass3Fourslash.ts similarity index 100% rename from tests/cases/fourslash/augmentedTypesClass3.ts rename to tests/cases/fourslash/augmentedTypesClass3Fourslash.ts diff --git a/tests/cases/fourslash/unusedInterfaceInNamespace1.ts b/tests/cases/fourslash/codeFixUnusedInterfaceInNamespace1.ts similarity index 100% rename from tests/cases/fourslash/unusedInterfaceInNamespace1.ts rename to tests/cases/fourslash/codeFixUnusedInterfaceInNamespace1.ts diff --git a/tests/cases/fourslash/unusedInterfaceInNamespace2.ts b/tests/cases/fourslash/codeFixUnusedInterfaceInNamespace2.ts similarity index 100% rename from tests/cases/fourslash/unusedInterfaceInNamespace2.ts rename to tests/cases/fourslash/codeFixUnusedInterfaceInNamespace2.ts diff --git a/tests/cases/fourslash/unusedNamespaceInNamespace.ts b/tests/cases/fourslash/codeFixUnusedNamespaceInNamespace.ts similarity index 100% rename from tests/cases/fourslash/unusedNamespaceInNamespace.ts rename to tests/cases/fourslash/codeFixUnusedNamespaceInNamespace.ts diff --git a/tests/cases/fourslash/commentsEnums.ts b/tests/cases/fourslash/commentsEnumsFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsEnums.ts rename to tests/cases/fourslash/commentsEnumsFourslash.ts diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModulesFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsExternalModules.ts rename to tests/cases/fourslash/commentsExternalModulesFourslash.ts diff --git a/tests/cases/fourslash/commentsInheritance.ts b/tests/cases/fourslash/commentsInheritanceFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsInheritance.ts rename to tests/cases/fourslash/commentsInheritanceFourslash.ts diff --git a/tests/cases/fourslash/commentsInterface.ts b/tests/cases/fourslash/commentsInterfaceFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsInterface.ts rename to tests/cases/fourslash/commentsInterfaceFourslash.ts diff --git a/tests/cases/fourslash/commentsModules.ts b/tests/cases/fourslash/commentsModulesFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsModules.ts rename to tests/cases/fourslash/commentsModulesFourslash.ts diff --git a/tests/cases/fourslash/commentsMultiModuleMultiFile.ts b/tests/cases/fourslash/commentsMultiModuleMultiFileFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsMultiModuleMultiFile.ts rename to tests/cases/fourslash/commentsMultiModuleMultiFileFourslash.ts diff --git a/tests/cases/fourslash/commentsMultiModuleSingleFile.ts b/tests/cases/fourslash/commentsMultiModuleSingleFileFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsMultiModuleSingleFile.ts rename to tests/cases/fourslash/commentsMultiModuleSingleFileFourslash.ts diff --git a/tests/cases/fourslash/commentsOverloads.ts b/tests/cases/fourslash/commentsOverloadsFourslash.ts similarity index 100% rename from tests/cases/fourslash/commentsOverloads.ts rename to tests/cases/fourslash/commentsOverloadsFourslash.ts diff --git a/tests/cases/fourslash/augmentedTypesClass2.ts b/tests/cases/fourslash/completionsAugmentedTypesClass2.ts similarity index 100% rename from tests/cases/fourslash/augmentedTypesClass2.ts rename to tests/cases/fourslash/completionsAugmentedTypesClass2.ts diff --git a/tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts b/tests/cases/fourslash/completionsExternalModuleReferenceResolutionOrderInImportDeclaration.ts similarity index 100% rename from tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts rename to tests/cases/fourslash/completionsExternalModuleReferenceResolutionOrderInImportDeclaration.ts diff --git a/tests/cases/fourslash/genericTypeWithMultipleBases1.ts b/tests/cases/fourslash/completionsGenericTypeWithMultipleBases1.ts similarity index 100% rename from tests/cases/fourslash/genericTypeWithMultipleBases1.ts rename to tests/cases/fourslash/completionsGenericTypeWithMultipleBases1.ts diff --git a/tests/cases/fourslash/mergedDeclarations1.ts b/tests/cases/fourslash/completionsMergedDeclarations1.ts similarity index 100% rename from tests/cases/fourslash/mergedDeclarations1.ts rename to tests/cases/fourslash/completionsMergedDeclarations1.ts diff --git a/tests/cases/fourslash/mergedDeclarations2.ts b/tests/cases/fourslash/completionsMergedDeclarations2.ts similarity index 100% rename from tests/cases/fourslash/mergedDeclarations2.ts rename to tests/cases/fourslash/completionsMergedDeclarations2.ts diff --git a/tests/cases/fourslash/contextualTypingOfArrayLiterals1.ts b/tests/cases/fourslash/contextualTypingOfArrayLiterals.ts similarity index 100% rename from tests/cases/fourslash/contextualTypingOfArrayLiterals1.ts rename to tests/cases/fourslash/contextualTypingOfArrayLiterals.ts diff --git a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/fourslash/diagnosticsJsFileCompilationDuplicateFunctionImplementation.ts similarity index 100% rename from tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts rename to tests/cases/fourslash/diagnosticsJsFileCompilationDuplicateFunctionImplementation.ts diff --git a/tests/cases/fourslash/multiModuleClodule1.ts b/tests/cases/fourslash/multiModuleClodule.ts similarity index 100% rename from tests/cases/fourslash/multiModuleClodule1.ts rename to tests/cases/fourslash/multiModuleClodule.ts diff --git a/tests/cases/fourslash/multiModuleFundule1.ts b/tests/cases/fourslash/multiModuleFundule.ts similarity index 100% rename from tests/cases/fourslash/multiModuleFundule1.ts rename to tests/cases/fourslash/multiModuleFundule.ts diff --git a/tests/cases/fourslash/assignToExistingClass.ts b/tests/cases/fourslash/quickInfoAssignToExistingClass.ts similarity index 100% rename from tests/cases/fourslash/assignToExistingClass.ts rename to tests/cases/fourslash/quickInfoAssignToExistingClass.ts diff --git a/tests/cases/fourslash/cloduleWithRecursiveReference.ts b/tests/cases/fourslash/quickInfoCloduleWithRecursiveReference.ts similarity index 100% rename from tests/cases/fourslash/cloduleWithRecursiveReference.ts rename to tests/cases/fourslash/quickInfoCloduleWithRecursiveReference.ts diff --git a/tests/cases/fourslash/contextualTyping.ts b/tests/cases/fourslash/quickInfoContextualTyping.ts similarity index 100% rename from tests/cases/fourslash/contextualTyping.ts rename to tests/cases/fourslash/quickInfoContextualTyping.ts diff --git a/tests/cases/fourslash/extendArray.ts b/tests/cases/fourslash/quickInfoExtendArray.ts similarity index 100% rename from tests/cases/fourslash/extendArray.ts rename to tests/cases/fourslash/quickInfoExtendArray.ts diff --git a/tests/cases/fourslash/forIn.ts b/tests/cases/fourslash/quickInfoForIn.ts similarity index 100% rename from tests/cases/fourslash/forIn.ts rename to tests/cases/fourslash/quickInfoForIn.ts diff --git a/tests/cases/fourslash/genericCombinators2.ts b/tests/cases/fourslash/quickInfoGenericCombinators2.ts similarity index 100% rename from tests/cases/fourslash/genericCombinators2.ts rename to tests/cases/fourslash/quickInfoGenericCombinators2.ts diff --git a/tests/cases/fourslash/genericTypeArgumentInference1.ts b/tests/cases/fourslash/quickInfoGenericTypeArgumentInference1.ts similarity index 100% rename from tests/cases/fourslash/genericTypeArgumentInference1.ts rename to tests/cases/fourslash/quickInfoGenericTypeArgumentInference1.ts diff --git a/tests/cases/fourslash/moduleVariables.ts b/tests/cases/fourslash/quickInfoModuleVariables.ts similarity index 100% rename from tests/cases/fourslash/moduleVariables.ts rename to tests/cases/fourslash/quickInfoModuleVariables.ts diff --git a/tests/cases/fourslash/namedTupleMembers.ts b/tests/cases/fourslash/quickInfoNamedTupleMembers.ts similarity index 100% rename from tests/cases/fourslash/namedTupleMembers.ts rename to tests/cases/fourslash/quickInfoNamedTupleMembers.ts diff --git a/tests/cases/fourslash/recursiveObjectLiteral.ts b/tests/cases/fourslash/quickInfoRecursiveObjectLiteral.ts similarity index 100% rename from tests/cases/fourslash/recursiveObjectLiteral.ts rename to tests/cases/fourslash/quickInfoRecursiveObjectLiteral.ts diff --git a/tests/cases/fourslash/staticPrototypePropertyOnClass.ts b/tests/cases/fourslash/quickInfoStaticPrototypePropertyOnClass.ts similarity index 100% rename from tests/cases/fourslash/staticPrototypePropertyOnClass.ts rename to tests/cases/fourslash/quickInfoStaticPrototypePropertyOnClass.ts diff --git a/tests/cases/fourslash/typeOfThisInStatics.ts b/tests/cases/fourslash/quickInfoTypeOfThisInStatics.ts similarity index 100% rename from tests/cases/fourslash/typeOfThisInStatics.ts rename to tests/cases/fourslash/quickInfoTypeOfThisInStatics.ts diff --git a/tests/cases/fourslash/typedGenericPrototypeMember.ts b/tests/cases/fourslash/quickInfoTypedGenericPrototypeMember.ts similarity index 100% rename from tests/cases/fourslash/typedGenericPrototypeMember.ts rename to tests/cases/fourslash/quickInfoTypedGenericPrototypeMember.ts diff --git a/tests/cases/fourslash/untypedModuleImport.ts b/tests/cases/fourslash/quickInfoUntypedModuleImport.ts similarity index 100% rename from tests/cases/fourslash/untypedModuleImport.ts rename to tests/cases/fourslash/quickInfoUntypedModuleImport.ts diff --git a/tests/cases/fourslash/widenedTypes.ts b/tests/cases/fourslash/quickInfoWidenedTypes.ts similarity index 100% rename from tests/cases/fourslash/widenedTypes.ts rename to tests/cases/fourslash/quickInfoWidenedTypes.ts