Add tests and baselines

This commit is contained in:
Kanchalai Tanglertsampan
2016-09-28 14:51:49 -07:00
parent 7945eb6f1a
commit a7f9d73498
4 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
//// [declarationEmitTypeAliasWithTypeParameters1.ts]
export type Bar<X, Y> = () => [X, Y];
export type Foo<Y> = Bar<any, Y>;
export const y = (x: Foo<string>) => 1
//// [declarationEmitTypeAliasWithTypeParameters1.js]
"use strict";
exports.y = function (x) { return 1; };
//// [declarationEmitTypeAliasWithTypeParameters1.d.ts]
export declare type Bar<X, Y> = () => [X, Y];
export declare type Foo<Y> = Bar<any, Y>;
export declare const y: (x: () => [any, string]) => number;

View File

@@ -0,0 +1,20 @@
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
export type Bar<X, Y> = () => [X, Y];
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0))
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16))
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18))
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16))
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18))
export type Foo<Y> = Bar<any, Y>;
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37))
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16))
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0))
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16))
export const y = (x: Foo<string>) => 1
>y : Symbol(y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 12))
>x : Symbol(x, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 18))
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37))

View File

@@ -0,0 +1,22 @@
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
export type Bar<X, Y> = () => [X, Y];
>Bar : Bar<X, Y>
>X : X
>Y : Y
>X : X
>Y : Y
export type Foo<Y> = Bar<any, Y>;
>Foo : () => [any, Y]
>Y : Y
>Bar : Bar<X, Y>
>Y : Y
export const y = (x: Foo<string>) => 1
>y : (x: () => [any, string]) => number
>(x: Foo<string>) => 1 : (x: () => [any, string]) => number
>x : () => [any, string]
>Foo : () => [any, Y]
>1 : 1

View File

@@ -0,0 +1,5 @@
// @declaration: true
export type Bar<X, Y> = () => [X, Y];
export type Foo<Y> = Bar<any, Y>;
export const y = (x: Foo<string>) => 1