Adding tests
This commit is contained in:
parent
b124b1d9e0
commit
f3bd294d0e
3 changed files with 163 additions and 0 deletions
52
tests/baselines/reference/parenthesizedTypes.js
Normal file
52
tests/baselines/reference/parenthesizedTypes.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
//// [parenthesizedTypes.ts]
|
||||
var a: string;
|
||||
var a: (string);
|
||||
var a: ((string) | string | (((string))));
|
||||
var a: ((((((((((((((((((((((((((((((((((((((((string))))))))))))))))))))))))))))))))))))))));
|
||||
|
||||
var b: (x: string) => string;
|
||||
var b: ((x: (string)) => (string));
|
||||
|
||||
var c: string[] | number[];
|
||||
var c: (string)[] | (number)[];
|
||||
var c: ((string)[]) | ((number)[]);
|
||||
|
||||
var d: (((x: string) => string) | ((x: number) => number))[];
|
||||
var d: ({ (x: string): string } | { (x: number): number })[];
|
||||
var d: Array<((x: string) => string) | ((x: number) => number)>;
|
||||
var d: Array<{ (x: string): string } | { (x: number): number }>;
|
||||
var d: (Array<{ (x: string): string } | { (x: number): number }>);
|
||||
|
||||
var e: typeof a[];
|
||||
var e: (typeof a)[];
|
||||
|
||||
var f: (string) => string;
|
||||
var f: (string: any) => string;
|
||||
|
||||
var g: [string, string];
|
||||
var g: [(string), string];
|
||||
var g: [(string), (((typeof a)))];
|
||||
|
||||
|
||||
//// [parenthesizedTypes.js]
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
var b;
|
||||
var b;
|
||||
var c;
|
||||
var c;
|
||||
var c;
|
||||
var d;
|
||||
var d;
|
||||
var d;
|
||||
var d;
|
||||
var d;
|
||||
var e;
|
||||
var e;
|
||||
var f;
|
||||
var f;
|
||||
var g;
|
||||
var g;
|
||||
var g;
|
84
tests/baselines/reference/parenthesizedTypes.types
Normal file
84
tests/baselines/reference/parenthesizedTypes.types
Normal file
|
@ -0,0 +1,84 @@
|
|||
=== tests/cases/conformance/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts ===
|
||||
var a: string;
|
||||
>a : string
|
||||
|
||||
var a: (string);
|
||||
>a : string
|
||||
|
||||
var a: ((string) | string | (((string))));
|
||||
>a : string
|
||||
|
||||
var a: ((((((((((((((((((((((((((((((((((((((((string))))))))))))))))))))))))))))))))))))))));
|
||||
>a : string
|
||||
|
||||
var b: (x: string) => string;
|
||||
>b : (x: string) => string
|
||||
>x : string
|
||||
|
||||
var b: ((x: (string)) => (string));
|
||||
>b : (x: string) => string
|
||||
>x : string
|
||||
|
||||
var c: string[] | number[];
|
||||
>c : string[] | number[]
|
||||
|
||||
var c: (string)[] | (number)[];
|
||||
>c : string[] | number[]
|
||||
|
||||
var c: ((string)[]) | ((number)[]);
|
||||
>c : string[] | number[]
|
||||
|
||||
var d: (((x: string) => string) | ((x: number) => number))[];
|
||||
>d : (((x: string) => string) | ((x: number) => number))[]
|
||||
>x : string
|
||||
>x : number
|
||||
|
||||
var d: ({ (x: string): string } | { (x: number): number })[];
|
||||
>d : (((x: string) => string) | ((x: number) => number))[]
|
||||
>x : string
|
||||
>x : number
|
||||
|
||||
var d: Array<((x: string) => string) | ((x: number) => number)>;
|
||||
>d : (((x: string) => string) | ((x: number) => number))[]
|
||||
>Array : T[]
|
||||
>x : string
|
||||
>x : number
|
||||
|
||||
var d: Array<{ (x: string): string } | { (x: number): number }>;
|
||||
>d : (((x: string) => string) | ((x: number) => number))[]
|
||||
>Array : T[]
|
||||
>x : string
|
||||
>x : number
|
||||
|
||||
var d: (Array<{ (x: string): string } | { (x: number): number }>);
|
||||
>d : (((x: string) => string) | ((x: number) => number))[]
|
||||
>Array : T[]
|
||||
>x : string
|
||||
>x : number
|
||||
|
||||
var e: typeof a[];
|
||||
>e : string[]
|
||||
>a : string
|
||||
|
||||
var e: (typeof a)[];
|
||||
>e : string[]
|
||||
>a : string
|
||||
|
||||
var f: (string) => string;
|
||||
>f : (string: any) => string
|
||||
>string : any
|
||||
|
||||
var f: (string: any) => string;
|
||||
>f : (string: any) => string
|
||||
>string : any
|
||||
|
||||
var g: [string, string];
|
||||
>g : [string, string]
|
||||
|
||||
var g: [(string), string];
|
||||
>g : [string, string]
|
||||
|
||||
var g: [(string), (((typeof a)))];
|
||||
>g : [string, string]
|
||||
>a : string
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
var a: string;
|
||||
var a: (string);
|
||||
var a: ((string) | string | (((string))));
|
||||
var a: ((((((((((((((((((((((((((((((((((((((((string))))))))))))))))))))))))))))))))))))))));
|
||||
|
||||
var b: (x: string) => string;
|
||||
var b: ((x: (string)) => (string));
|
||||
|
||||
var c: string[] | number[];
|
||||
var c: (string)[] | (number)[];
|
||||
var c: ((string)[]) | ((number)[]);
|
||||
|
||||
var d: (((x: string) => string) | ((x: number) => number))[];
|
||||
var d: ({ (x: string): string } | { (x: number): number })[];
|
||||
var d: Array<((x: string) => string) | ((x: number) => number)>;
|
||||
var d: Array<{ (x: string): string } | { (x: number): number }>;
|
||||
var d: (Array<{ (x: string): string } | { (x: number): number }>);
|
||||
|
||||
var e: typeof a[];
|
||||
var e: (typeof a)[];
|
||||
|
||||
var f: (string) => string;
|
||||
var f: (string: any) => string;
|
||||
|
||||
var g: [string, string];
|
||||
var g: [(string), string];
|
||||
var g: [(string), (((typeof a)))];
|
Loading…
Reference in a new issue