-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10928 from Microsoft/addTestFix10625
[Release-2.0] Add tests and baselines
- Loading branch information
Showing
8 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
tests/baselines/reference/declarationEmitInferedTypeAlias2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//// [tests/cases/compiler/declarationEmitInferedTypeAlias2.ts] //// | ||
|
||
//// [0.ts] | ||
|
||
{ | ||
type Data = string | boolean; | ||
let obj: Data = true; | ||
} | ||
export { } | ||
|
||
//// [1.ts] | ||
var x = "hi" || 5; | ||
export default x; | ||
|
||
//// [0.js] | ||
"use strict"; | ||
{ | ||
var obj = true; | ||
} | ||
//// [1.js] | ||
"use strict"; | ||
var x = "hi" || 5; | ||
exports.__esModule = true; | ||
exports["default"] = x; | ||
|
||
|
||
//// [0.d.ts] | ||
export { }; | ||
//// [1.d.ts] | ||
declare var x: string | number; | ||
export default x; |
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/declarationEmitInferedTypeAlias2.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== tests/cases/compiler/0.ts === | ||
|
||
{ | ||
type Data = string | boolean; | ||
>Data : Symbol(Data, Decl(0.ts, 1, 1)) | ||
|
||
let obj: Data = true; | ||
>obj : Symbol(obj, Decl(0.ts, 3, 7)) | ||
>Data : Symbol(Data, Decl(0.ts, 1, 1)) | ||
} | ||
export { } | ||
|
||
=== tests/cases/compiler/1.ts === | ||
var x = "hi" || 5; | ||
>x : Symbol(x, Decl(1.ts, 0, 3)) | ||
|
||
export default x; | ||
>x : Symbol(x, Decl(1.ts, 0, 3)) | ||
|
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/declarationEmitInferedTypeAlias2.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
=== tests/cases/compiler/0.ts === | ||
|
||
{ | ||
type Data = string | boolean; | ||
>Data : Data | ||
|
||
let obj: Data = true; | ||
>obj : Data | ||
>Data : Data | ||
>true : true | ||
} | ||
export { } | ||
|
||
=== tests/cases/compiler/1.ts === | ||
var x = "hi" || 5; | ||
>x : string | number | ||
>"hi" || 5 : string | number | ||
>"hi" : string | ||
>5 : number | ||
|
||
export default x; | ||
>x : string | number | ||
|
38 changes: 38 additions & 0 deletions
38
tests/baselines/reference/declarationEmitInferedTypeAlias3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//// [tests/cases/compiler/declarationEmitInferedTypeAlias3.ts] //// | ||
|
||
//// [0.ts] | ||
|
||
{ | ||
type Data = string | boolean; | ||
let obj: Data = true; | ||
} | ||
export { } | ||
|
||
//// [1.ts] | ||
let v = "str" || true; | ||
function bar () { | ||
return v; | ||
} | ||
export { v, bar } | ||
|
||
//// [0.js] | ||
"use strict"; | ||
{ | ||
var obj = true; | ||
} | ||
//// [1.js] | ||
"use strict"; | ||
var v = "str" || true; | ||
exports.v = v; | ||
function bar() { | ||
return v; | ||
} | ||
exports.bar = bar; | ||
|
||
|
||
//// [0.d.ts] | ||
export { }; | ||
//// [1.d.ts] | ||
declare let v: string | boolean; | ||
declare function bar(): string | boolean; | ||
export { v, bar }; |
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/declarationEmitInferedTypeAlias3.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
=== tests/cases/compiler/0.ts === | ||
|
||
{ | ||
type Data = string | boolean; | ||
>Data : Symbol(Data, Decl(0.ts, 1, 1)) | ||
|
||
let obj: Data = true; | ||
>obj : Symbol(obj, Decl(0.ts, 3, 7)) | ||
>Data : Symbol(Data, Decl(0.ts, 1, 1)) | ||
} | ||
export { } | ||
|
||
=== tests/cases/compiler/1.ts === | ||
let v = "str" || true; | ||
>v : Symbol(v, Decl(1.ts, 0, 3)) | ||
|
||
function bar () { | ||
>bar : Symbol(bar, Decl(1.ts, 0, 22)) | ||
|
||
return v; | ||
>v : Symbol(v, Decl(1.ts, 0, 3)) | ||
} | ||
export { v, bar } | ||
>v : Symbol(v, Decl(1.ts, 4, 8)) | ||
>bar : Symbol(bar, Decl(1.ts, 4, 11)) | ||
|
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/declarationEmitInferedTypeAlias3.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
=== tests/cases/compiler/0.ts === | ||
|
||
{ | ||
type Data = string | boolean; | ||
>Data : Data | ||
|
||
let obj: Data = true; | ||
>obj : Data | ||
>Data : Data | ||
>true : true | ||
} | ||
export { } | ||
|
||
=== tests/cases/compiler/1.ts === | ||
let v = "str" || true; | ||
>v : Data | ||
>"str" || true : Data | ||
>"str" : string | ||
>true : boolean | ||
|
||
function bar () { | ||
>bar : () => Data | ||
|
||
return v; | ||
>v : Data | ||
} | ||
export { v, bar } | ||
>v : Data | ||
>bar : () => Data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @declaration: true | ||
// @skipDefaultLibCheck: true | ||
|
||
// @Filename: 0.ts | ||
{ | ||
type Data = string | boolean; | ||
let obj: Data = true; | ||
} | ||
export { } | ||
|
||
// @Filename: 1.ts | ||
var x = "hi" || 5; | ||
export default x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @declaration: true | ||
// @skipDefaultLibCheck: true | ||
|
||
// @Filename: 0.ts | ||
{ | ||
type Data = string | boolean; | ||
let obj: Data = true; | ||
} | ||
export { } | ||
|
||
// @Filename: 1.ts | ||
let v = "str" || true; | ||
function bar () { | ||
return v; | ||
} | ||
export { v, bar } |