mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-12 19:31:16 -05:00
added .d.ts generation tests
This commit is contained in:
28
tests/baselines/reference/constEnumDeclarations.js
Normal file
28
tests/baselines/reference/constEnumDeclarations.js
Normal file
@@ -0,0 +1,28 @@
|
||||
//// [constEnumDeclarations.ts]
|
||||
|
||||
const enum E {
|
||||
A = 1,
|
||||
B = 2,
|
||||
C = A | B
|
||||
}
|
||||
|
||||
const enum E2 {
|
||||
A = 1,
|
||||
B,
|
||||
C
|
||||
}
|
||||
|
||||
//// [constEnumDeclarations.js]
|
||||
|
||||
|
||||
//// [constEnumDeclarations.d.ts]
|
||||
declare const enum E {
|
||||
A = 1,
|
||||
B = 2,
|
||||
C = 3,
|
||||
}
|
||||
declare const enum E2 {
|
||||
A = 1,
|
||||
B = 2,
|
||||
C = 3,
|
||||
}
|
||||
30
tests/baselines/reference/constEnumDeclarations.types
Normal file
30
tests/baselines/reference/constEnumDeclarations.types
Normal file
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/constEnumDeclarations.ts ===
|
||||
|
||||
const enum E {
|
||||
>E : E
|
||||
|
||||
A = 1,
|
||||
>A : E
|
||||
|
||||
B = 2,
|
||||
>B : E
|
||||
|
||||
C = A | B
|
||||
>C : E
|
||||
>A | B : number
|
||||
>A : E
|
||||
>B : E
|
||||
}
|
||||
|
||||
const enum E2 {
|
||||
>E2 : E2
|
||||
|
||||
A = 1,
|
||||
>A : E2
|
||||
|
||||
B,
|
||||
>B : E2
|
||||
|
||||
C
|
||||
>C : E2
|
||||
}
|
||||
13
tests/cases/compiler/constEnumDeclarations.ts
Normal file
13
tests/cases/compiler/constEnumDeclarations.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// @declaration: true
|
||||
|
||||
const enum E {
|
||||
A = 1,
|
||||
B = 2,
|
||||
C = A | B
|
||||
}
|
||||
|
||||
const enum E2 {
|
||||
A = 1,
|
||||
B,
|
||||
C
|
||||
}
|
||||
Reference in New Issue
Block a user