From 271429544331e335d2e1b6ed4dccb4d27609b6d7 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 2 May 2017 16:22:28 -0700 Subject: [PATCH] Add declaration file output to tests --- tests/baselines/reference/dynamicNames.js | 26 +++++++++++++++-- .../baselines/reference/dynamicNames.symbols | 29 ++++++++++--------- tests/baselines/reference/dynamicNames.types | 10 +++++-- tests/cases/compiler/dynamicNames.ts | 6 ++-- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/tests/baselines/reference/dynamicNames.js b/tests/baselines/reference/dynamicNames.js index 766494683e1..173c02b4448 100644 --- a/tests/baselines/reference/dynamicNames.js +++ b/tests/baselines/reference/dynamicNames.js @@ -3,6 +3,7 @@ //// [module.ts] export const c0 = "a"; export const c1 = 1; +const c2 = "a"; export interface T0 { [c0]: number; [c1]: string; @@ -14,7 +15,7 @@ export declare class T1 implements T2 { export declare class T2 extends T1 { } export declare type T3 = { - [c0]: number; + [c2]: number; [c1]: string; }; @@ -98,7 +99,7 @@ let t15: T15; // assignability t0 = t1, t0 = t2, t0 = t3, t1 = t0, t1 = t2, t1 = t3, t2 = t0, t2 = t1, t2 = t3, t3 = t0, t3 = t1, t3 = t2; -t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; +t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; t0 = t12, t0 = t13, t0 = t14, t0 = t15, t12 = t0, t13 = t0, t14 = t0, t15 = t0; //// [module.js] @@ -106,6 +107,7 @@ t0 = t12, t0 = t13, t0 = t14, t0 = t15, t12 = t0, t13 = t0, t14 = t0, t15 = t0; Object.defineProperty(exports, "__esModule", { value: true }); exports.c0 = "a"; exports.c1 = 1; +const c2 = "a"; //// [main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -140,3 +142,23 @@ let t15; t0 = t1, t0 = t2, t0 = t3, t1 = t0, t1 = t2, t1 = t3, t2 = t0, t2 = t1, t2 = t3, t3 = t0, t3 = t1, t3 = t2; t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; t0 = t12, t0 = t13, t0 = t14, t0 = t15, t12 = t0, t13 = t0, t14 = t0, t15 = t0; + + +//// [module.d.ts] +export declare const c0 = "a"; +export declare const c1 = 1; +export interface T0 { + [c0]: number; + [c1]: string; +} +export declare class T1 implements T2 { + [c0]: number; + [c1]: string; +} +export declare class T2 extends T1 { +} +export declare type T3 = { + "a": number; + [c1]: string; +}; +//// [main.d.ts] diff --git a/tests/baselines/reference/dynamicNames.symbols b/tests/baselines/reference/dynamicNames.symbols index 09970da02e1..12dd6576b74 100644 --- a/tests/baselines/reference/dynamicNames.symbols +++ b/tests/baselines/reference/dynamicNames.symbols @@ -5,8 +5,11 @@ export const c0 = "a"; export const c1 = 1; >c1 : Symbol(c1, Decl(module.ts, 1, 12)) +const c2 = "a"; +>c2 : Symbol(c2, Decl(module.ts, 2, 5)) + export interface T0 { ->T0 : Symbol(T0, Decl(module.ts, 1, 20)) +>T0 : Symbol(T0, Decl(module.ts, 2, 15)) [c0]: number; >c0 : Symbol(c0, Decl(module.ts, 0, 12)) @@ -15,8 +18,8 @@ export interface T0 { >c1 : Symbol(c1, Decl(module.ts, 1, 12)) } export declare class T1 implements T2 { ->T1 : Symbol(T1, Decl(module.ts, 5, 1)) ->T2 : Symbol(T2, Decl(module.ts, 9, 1)) +>T1 : Symbol(T1, Decl(module.ts, 6, 1)) +>T2 : Symbol(T2, Decl(module.ts, 10, 1)) [c0]: number; >c0 : Symbol(c0, Decl(module.ts, 0, 12)) @@ -25,14 +28,14 @@ export declare class T1 implements T2 { >c1 : Symbol(c1, Decl(module.ts, 1, 12)) } export declare class T2 extends T1 { ->T2 : Symbol(T2, Decl(module.ts, 9, 1)) ->T1 : Symbol(T1, Decl(module.ts, 5, 1)) +>T2 : Symbol(T2, Decl(module.ts, 10, 1)) +>T1 : Symbol(T1, Decl(module.ts, 6, 1)) } export declare type T3 = { ->T3 : Symbol(T3, Decl(module.ts, 11, 1)) +>T3 : Symbol(T3, Decl(module.ts, 12, 1)) - [c0]: number; ->c0 : Symbol(c0, Decl(module.ts, 0, 12)) + [c2]: number; +>c2 : Symbol(c2, Decl(module.ts, 2, 5)) [c1]: string; >c1 : Symbol(c1, Decl(module.ts, 1, 12)) @@ -196,22 +199,22 @@ let t3: T3; let t0_1: M.T0; >t0_1 : Symbol(t0_1, Decl(main.ts, 60, 3)) >M : Symbol(M, Decl(main.ts, 1, 6)) ->T0 : Symbol(T0, Decl(module.ts, 1, 20)) +>T0 : Symbol(T0, Decl(module.ts, 2, 15)) let t1_1: M.T1; >t1_1 : Symbol(t1_1, Decl(main.ts, 61, 3)) >M : Symbol(M, Decl(main.ts, 1, 6)) ->T1 : Symbol(T1, Decl(module.ts, 5, 1)) +>T1 : Symbol(T1, Decl(module.ts, 6, 1)) let t2_1: M.T2; >t2_1 : Symbol(t2_1, Decl(main.ts, 62, 3)) >M : Symbol(M, Decl(main.ts, 1, 6)) ->T2 : Symbol(T2, Decl(module.ts, 9, 1)) +>T2 : Symbol(T2, Decl(module.ts, 10, 1)) let t3_1: M.T3; >t3_1 : Symbol(t3_1, Decl(main.ts, 63, 3)) >M : Symbol(M, Decl(main.ts, 1, 6)) ->T3 : Symbol(T3, Decl(module.ts, 11, 1)) +>T3 : Symbol(T3, Decl(module.ts, 12, 1)) let t4: N.T4; >t4 : Symbol(t4, Decl(main.ts, 64, 3)) @@ -292,7 +295,7 @@ t0 = t1, t0 = t2, t0 = t3, t1 = t0, t1 = t2, t1 = t3, t2 = t0, t2 = t1, t2 = t3, >t3 : Symbol(t3, Decl(main.ts, 59, 3)) >t2 : Symbol(t2, Decl(main.ts, 58, 3)) -t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; +t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; >t4 : Symbol(t4, Decl(main.ts, 64, 3)) >t5 : Symbol(t5, Decl(main.ts, 65, 3)) >t4 : Symbol(t4, Decl(main.ts, 64, 3)) diff --git a/tests/baselines/reference/dynamicNames.types b/tests/baselines/reference/dynamicNames.types index 509b0a3f937..8d46cb8b6f8 100644 --- a/tests/baselines/reference/dynamicNames.types +++ b/tests/baselines/reference/dynamicNames.types @@ -7,6 +7,10 @@ export const c1 = 1; >c1 : 1 >1 : 1 +const c2 = "a"; +>c2 : "a" +>"a" : "a" + export interface T0 { >T0 : T0 @@ -33,8 +37,8 @@ export declare class T2 extends T1 { export declare type T3 = { >T3 : T3 - [c0]: number; ->c0 : "a" + [c2]: number; +>c2 : "a" [c1]: string; >c1 : 1 @@ -321,7 +325,7 @@ t0 = t1, t0 = t2, t0 = t3, t1 = t0, t1 = t2, t1 = t3, t2 = t0, t2 = t1, t2 = t3, >t3 : T3 >t2 : T2 -t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; +t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; >t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6 : N.T6 >t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5 : N.T5 >t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4 : N.T4 diff --git a/tests/cases/compiler/dynamicNames.ts b/tests/cases/compiler/dynamicNames.ts index f99a49e975d..473d5bc3a8d 100644 --- a/tests/cases/compiler/dynamicNames.ts +++ b/tests/cases/compiler/dynamicNames.ts @@ -1,8 +1,10 @@ // @target: esnext // @module: commonjs +// @declaration: true // @filename: module.ts export const c0 = "a"; export const c1 = 1; +const c2 = "a"; export interface T0 { [c0]: number; [c1]: string; @@ -14,7 +16,7 @@ export declare class T1 implements T2 { export declare class T2 extends T1 { } export declare type T3 = { - [c0]: number; + [c2]: number; [c1]: string; }; @@ -98,5 +100,5 @@ let t15: T15; // assignability t0 = t1, t0 = t2, t0 = t3, t1 = t0, t1 = t2, t1 = t3, t2 = t0, t2 = t1, t2 = t3, t3 = t0, t3 = t1, t3 = t2; -t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; +t4 = t5, t4 = t6, t4 = t7, t5 = t4, t5 = t6, t5 = t7, t6 = t4, t6 = t5, t6 = t7, t7 = t4, t7 = t5, t7 = t6; t0 = t12, t0 = t13, t0 = t14, t0 = t15, t12 = t0, t13 = t0, t14 = t0, t15 = t0; \ No newline at end of file