mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Forbid duplicates in baselines (#44652)
* Forbid duplicates in baselines The check is case insensitive. * Update baselines and add semi-colons Gotta have those semicolons.
This commit is contained in:
1 parent
580bb066c1
commit
0f216f36ec
42 files changed
+79
-62
No files matched your search
@@ -6,9 +6,26 @@ namespace Harness {
|
||||
|
||||
function runTests(runners: RunnerBase[]) {
|
||||
for (let i = iterations; i > 0; i--) {
|
||||
const seen = new Map<string, string>();
|
||||
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)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
+2
-2
@@ -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 ||
|
||||
@@ -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))
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
=== tests/cases/compiler/abstractProperty.ts ===
|
||||
=== tests/cases/compiler/abstractPropertyBasics.ts ===
|
||||
interface A {
|
||||
prop: string;
|
||||
>prop : string
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user