Skip to content

Commit b0f1437

Browse files
Added test that will change with this PR.
1 parent ddc417b commit b0f1437

File tree

4 files changed

+278
-0
lines changed

4 files changed

+278
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
//// [tests/cases/compiler/verbatim-declarations-literals.ts] ////
2+
3+
//// [verbatim-declarations-literals.ts]
4+
enum E { "some value" = 1 };
5+
const e: typeof E["some value"] = E["some value"];
6+
7+
declare function f3<T>(a: T, b: T): T;
8+
const x3 = f3("abc", "def"); // "abc" | "def"
9+
10+
const octal = 0o16;
11+
const octalParen = ((0o16));
12+
const octalIndirect = octal;
13+
14+
const hex = 0x10;
15+
const hexParen = ((0x10));
16+
const hexIndirect = hex;
17+
18+
const seps = 1_000_000;
19+
const sepsParen = (1_000_000);
20+
const sepsIndirect = seps;
21+
22+
const singleQuote = 'x'
23+
const singleQuoteParen = (('x'))
24+
const singleQuoteIndirect = singleQuote;
25+
26+
const noSubstTemplate = `Test`
27+
const noSubstTemplateParen = (`Test`)
28+
const noSubstTemplateIndirect = noSubstTemplate;
29+
30+
31+
//// [verbatim-declarations-literals.js]
32+
"use strict";
33+
var E;
34+
(function (E) {
35+
E[E["some value"] = 1] = "some value";
36+
})(E || (E = {}));
37+
;
38+
const e = E["some value"];
39+
const x3 = f3("abc", "def"); // "abc" | "def"
40+
const octal = 0o16;
41+
const octalParen = ((0o16));
42+
const octalIndirect = octal;
43+
const hex = 0x10;
44+
const hexParen = ((0x10));
45+
const hexIndirect = hex;
46+
const seps = 1_000_000;
47+
const sepsParen = (1_000_000);
48+
const sepsIndirect = seps;
49+
const singleQuote = 'x';
50+
const singleQuoteParen = (('x'));
51+
const singleQuoteIndirect = singleQuote;
52+
const noSubstTemplate = `Test`;
53+
const noSubstTemplateParen = (`Test`);
54+
const noSubstTemplateIndirect = noSubstTemplate;
55+
56+
57+
//// [verbatim-declarations-literals.d.ts]
58+
declare enum E {
59+
"some value" = 1
60+
}
61+
declare const e = E["some value"];
62+
declare function f3<T>(a: T, b: T): T;
63+
declare const x3: string;
64+
declare const octal = 14;
65+
declare const octalParen = 14;
66+
declare const octalIndirect = 14;
67+
declare const hex = 16;
68+
declare const hexParen = 16;
69+
declare const hexIndirect = 16;
70+
declare const seps = 1000000;
71+
declare const sepsParen = 1000000;
72+
declare const sepsIndirect = 1000000;
73+
declare const singleQuote = "x";
74+
declare const singleQuoteParen = "x";
75+
declare const singleQuoteIndirect = "x";
76+
declare const noSubstTemplate = "Test";
77+
declare const noSubstTemplateParen = "Test";
78+
declare const noSubstTemplateIndirect = "Test";
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//// [tests/cases/compiler/verbatim-declarations-literals.ts] ////
2+
3+
=== verbatim-declarations-literals.ts ===
4+
enum E { "some value" = 1 };
5+
>E : Symbol(E, Decl(verbatim-declarations-literals.ts, 0, 0))
6+
>"some value" : Symbol(E["some value"], Decl(verbatim-declarations-literals.ts, 0, 8))
7+
8+
const e: typeof E["some value"] = E["some value"];
9+
>e : Symbol(e, Decl(verbatim-declarations-literals.ts, 1, 5))
10+
>E : Symbol(E, Decl(verbatim-declarations-literals.ts, 0, 0))
11+
>E : Symbol(E, Decl(verbatim-declarations-literals.ts, 0, 0))
12+
>"some value" : Symbol(E["some value"], Decl(verbatim-declarations-literals.ts, 0, 8))
13+
14+
declare function f3<T>(a: T, b: T): T;
15+
>f3 : Symbol(f3, Decl(verbatim-declarations-literals.ts, 1, 50))
16+
>T : Symbol(T, Decl(verbatim-declarations-literals.ts, 3, 20))
17+
>a : Symbol(a, Decl(verbatim-declarations-literals.ts, 3, 23))
18+
>T : Symbol(T, Decl(verbatim-declarations-literals.ts, 3, 20))
19+
>b : Symbol(b, Decl(verbatim-declarations-literals.ts, 3, 28))
20+
>T : Symbol(T, Decl(verbatim-declarations-literals.ts, 3, 20))
21+
>T : Symbol(T, Decl(verbatim-declarations-literals.ts, 3, 20))
22+
23+
const x3 = f3("abc", "def"); // "abc" | "def"
24+
>x3 : Symbol(x3, Decl(verbatim-declarations-literals.ts, 4, 5))
25+
>f3 : Symbol(f3, Decl(verbatim-declarations-literals.ts, 1, 50))
26+
27+
const octal = 0o16;
28+
>octal : Symbol(octal, Decl(verbatim-declarations-literals.ts, 6, 5))
29+
30+
const octalParen = ((0o16));
31+
>octalParen : Symbol(octalParen, Decl(verbatim-declarations-literals.ts, 7, 5))
32+
33+
const octalIndirect = octal;
34+
>octalIndirect : Symbol(octalIndirect, Decl(verbatim-declarations-literals.ts, 8, 5))
35+
>octal : Symbol(octal, Decl(verbatim-declarations-literals.ts, 6, 5))
36+
37+
const hex = 0x10;
38+
>hex : Symbol(hex, Decl(verbatim-declarations-literals.ts, 10, 5))
39+
40+
const hexParen = ((0x10));
41+
>hexParen : Symbol(hexParen, Decl(verbatim-declarations-literals.ts, 11, 5))
42+
43+
const hexIndirect = hex;
44+
>hexIndirect : Symbol(hexIndirect, Decl(verbatim-declarations-literals.ts, 12, 5))
45+
>hex : Symbol(hex, Decl(verbatim-declarations-literals.ts, 10, 5))
46+
47+
const seps = 1_000_000;
48+
>seps : Symbol(seps, Decl(verbatim-declarations-literals.ts, 14, 5))
49+
50+
const sepsParen = (1_000_000);
51+
>sepsParen : Symbol(sepsParen, Decl(verbatim-declarations-literals.ts, 15, 5))
52+
53+
const sepsIndirect = seps;
54+
>sepsIndirect : Symbol(sepsIndirect, Decl(verbatim-declarations-literals.ts, 16, 5))
55+
>seps : Symbol(seps, Decl(verbatim-declarations-literals.ts, 14, 5))
56+
57+
const singleQuote = 'x'
58+
>singleQuote : Symbol(singleQuote, Decl(verbatim-declarations-literals.ts, 18, 5))
59+
60+
const singleQuoteParen = (('x'))
61+
>singleQuoteParen : Symbol(singleQuoteParen, Decl(verbatim-declarations-literals.ts, 19, 5))
62+
63+
const singleQuoteIndirect = singleQuote;
64+
>singleQuoteIndirect : Symbol(singleQuoteIndirect, Decl(verbatim-declarations-literals.ts, 20, 5))
65+
>singleQuote : Symbol(singleQuote, Decl(verbatim-declarations-literals.ts, 18, 5))
66+
67+
const noSubstTemplate = `Test`
68+
>noSubstTemplate : Symbol(noSubstTemplate, Decl(verbatim-declarations-literals.ts, 22, 5))
69+
70+
const noSubstTemplateParen = (`Test`)
71+
>noSubstTemplateParen : Symbol(noSubstTemplateParen, Decl(verbatim-declarations-literals.ts, 23, 5))
72+
73+
const noSubstTemplateIndirect = noSubstTemplate;
74+
>noSubstTemplateIndirect : Symbol(noSubstTemplateIndirect, Decl(verbatim-declarations-literals.ts, 24, 5))
75+
>noSubstTemplate : Symbol(noSubstTemplate, Decl(verbatim-declarations-literals.ts, 22, 5))
76+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
//// [tests/cases/compiler/verbatim-declarations-literals.ts] ////
2+
3+
=== verbatim-declarations-literals.ts ===
4+
enum E { "some value" = 1 };
5+
>E : E
6+
>"some value" : (typeof E)["some value"]
7+
>1 : 1
8+
9+
const e: typeof E["some value"] = E["some value"];
10+
>e : (typeof E)["some value"]
11+
>E : typeof E
12+
>E["some value"] : E
13+
>E : typeof E
14+
>"some value" : "some value"
15+
16+
declare function f3<T>(a: T, b: T): T;
17+
>f3 : <T>(a: T, b: T) => T
18+
>a : T
19+
>b : T
20+
21+
const x3 = f3("abc", "def"); // "abc" | "def"
22+
>x3 : "abc" | "def"
23+
>f3("abc", "def") : "abc" | "def"
24+
>f3 : <T>(a: T, b: T) => T
25+
>"abc" : "abc"
26+
>"def" : "def"
27+
28+
const octal = 0o16;
29+
>octal : 14
30+
>0o16 : 14
31+
32+
const octalParen = ((0o16));
33+
>octalParen : 14
34+
>((0o16)) : 14
35+
>(0o16) : 14
36+
>0o16 : 14
37+
38+
const octalIndirect = octal;
39+
>octalIndirect : 14
40+
>octal : 14
41+
42+
const hex = 0x10;
43+
>hex : 16
44+
>0x10 : 16
45+
46+
const hexParen = ((0x10));
47+
>hexParen : 16
48+
>((0x10)) : 16
49+
>(0x10) : 16
50+
>0x10 : 16
51+
52+
const hexIndirect = hex;
53+
>hexIndirect : 16
54+
>hex : 16
55+
56+
const seps = 1_000_000;
57+
>seps : 1000000
58+
>1_000_000 : 1000000
59+
60+
const sepsParen = (1_000_000);
61+
>sepsParen : 1000000
62+
>(1_000_000) : 1000000
63+
>1_000_000 : 1000000
64+
65+
const sepsIndirect = seps;
66+
>sepsIndirect : 1000000
67+
>seps : 1000000
68+
69+
const singleQuote = 'x'
70+
>singleQuote : "x"
71+
>'x' : "x"
72+
73+
const singleQuoteParen = (('x'))
74+
>singleQuoteParen : "x"
75+
>(('x')) : "x"
76+
>('x') : "x"
77+
>'x' : "x"
78+
79+
const singleQuoteIndirect = singleQuote;
80+
>singleQuoteIndirect : "x"
81+
>singleQuote : "x"
82+
83+
const noSubstTemplate = `Test`
84+
>noSubstTemplate : "Test"
85+
>`Test` : "Test"
86+
87+
const noSubstTemplateParen = (`Test`)
88+
>noSubstTemplateParen : "Test"
89+
>(`Test`) : "Test"
90+
>`Test` : "Test"
91+
92+
const noSubstTemplateIndirect = noSubstTemplate;
93+
>noSubstTemplateIndirect : "Test"
94+
>noSubstTemplate : "Test"
95+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @strict: true
2+
// @declaration: true
3+
// @target: esnext
4+
5+
enum E { "some value" = 1 };
6+
const e: typeof E["some value"] = E["some value"];
7+
8+
declare function f3<T>(a: T, b: T): T;
9+
const x3 = f3("abc", "def"); // "abc" | "def"
10+
11+
const octal = 0o16;
12+
const octalParen = ((0o16));
13+
const octalIndirect = octal;
14+
15+
const hex = 0x10;
16+
const hexParen = ((0x10));
17+
const hexIndirect = hex;
18+
19+
const seps = 1_000_000;
20+
const sepsParen = (1_000_000);
21+
const sepsIndirect = seps;
22+
23+
const singleQuote = 'x'
24+
const singleQuoteParen = (('x'))
25+
const singleQuoteIndirect = singleQuote;
26+
27+
const noSubstTemplate = `Test`
28+
const noSubstTemplateParen = (`Test`)
29+
const noSubstTemplateIndirect = noSubstTemplate;

0 commit comments

Comments
 (0)