Skip to content

Commit da49461

Browse files
committed
Adds tests
1 parent e7fe5d7 commit da49461

18 files changed

Lines changed: 903 additions & 0 deletions
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(3,8): error TS1123: Variable declaration list cannot be empty.
2+
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(4,5): error TS2304: Cannot find name 'let'.
3+
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(5,10): error TS1123: Variable declaration list cannot be empty.
4+
5+
6+
==== tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts (3 errors) ====
7+
8+
module Inner {
9+
var;
10+
11+
!!! error TS1123: Variable declaration list cannot be empty.
12+
let;
13+
~~~
14+
!!! error TS2304: Cannot find name 'let'.
15+
const;
16+
17+
!!! error TS1123: Variable declaration list cannot be empty.
18+
19+
export var a;
20+
export let b;
21+
export var c: string;
22+
export let d: number;
23+
class A {}
24+
export var e: A;
25+
export let f: A;
26+
27+
namespace B {
28+
export let a = 1, b, c = 2;
29+
export let x, y, z;
30+
}
31+
32+
module C {
33+
export var a = 1, b, c = 2;
34+
export var x, y, z;
35+
}
36+
37+
// Shouldn't be filtered
38+
export var a1 = 1;
39+
export let b1 = 1;
40+
export var c1: string = 'a';
41+
export let d1: number = 1;
42+
class D {}
43+
export var e1 = new D;
44+
export let f1 = new D;
45+
export var g1: D = new D;
46+
export let h1: D = new D;
47+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//// [NonInitializedExportInInternalModule.ts]
2+
3+
module Inner {
4+
var;
5+
let;
6+
const;
7+
8+
export var a;
9+
export let b;
10+
export var c: string;
11+
export let d: number;
12+
class A {}
13+
export var e: A;
14+
export let f: A;
15+
16+
namespace B {
17+
export let a = 1, b, c = 2;
18+
export let x, y, z;
19+
}
20+
21+
module C {
22+
export var a = 1, b, c = 2;
23+
export var x, y, z;
24+
}
25+
26+
// Shouldn't be filtered
27+
export var a1 = 1;
28+
export let b1 = 1;
29+
export var c1: string = 'a';
30+
export let d1: number = 1;
31+
class D {}
32+
export var e1 = new D;
33+
export let f1 = new D;
34+
export var g1: D = new D;
35+
export let h1: D = new D;
36+
}
37+
38+
//// [NonInitializedExportInInternalModule.js]
39+
var Inner;
40+
(function (Inner) {
41+
var ;
42+
let;
43+
var ;
44+
var A = (function () {
45+
function A() {
46+
}
47+
return A;
48+
})();
49+
var B;
50+
(function (B) {
51+
B.a = 1, B.c = 2;
52+
})(B || (B = {}));
53+
var C;
54+
(function (C) {
55+
C.a = 1, C.c = 2;
56+
})(C || (C = {}));
57+
// Shouldn't be filtered
58+
Inner.a1 = 1;
59+
Inner.b1 = 1;
60+
Inner.c1 = 'a';
61+
Inner.d1 = 1;
62+
var D = (function () {
63+
function D() {
64+
}
65+
return D;
66+
})();
67+
Inner.e1 = new D;
68+
Inner.f1 = new D;
69+
Inner.g1 = new D;
70+
Inner.h1 = new D;
71+
})(Inner || (Inner = {}));
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(2,4): error TS1123: Variable declaration list cannot be empty.
2+
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(3,1): error TS2304: Cannot find name 'let'.
3+
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(4,6): error TS1123: Variable declaration list cannot be empty.
4+
5+
6+
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts (3 errors) ====
7+
8+
var;
9+
10+
!!! error TS1123: Variable declaration list cannot be empty.
11+
let;
12+
~~~
13+
!!! error TS2304: Cannot find name 'let'.
14+
const;
15+
16+
!!! error TS1123: Variable declaration list cannot be empty.
17+
18+
export var a;
19+
export let b;
20+
export var c: string;
21+
export let d: number;
22+
class A {}
23+
export var e: A;
24+
export let f: A;
25+
26+
namespace B {
27+
export let a = 1, b, c = 2;
28+
export let x, y, z;
29+
}
30+
31+
module C {
32+
export var a = 1, b, c = 2;
33+
export var x, y, z;
34+
}
35+
36+
// Shouldn't be filtered
37+
export var a1 = 1;
38+
export let b1 = 1;
39+
export var c1: string = 'a';
40+
export let d1: number = 1;
41+
class D {}
42+
export var e1 = new D;
43+
export let f1 = new D;
44+
export var g1: D = new D;
45+
export let h1: D = new D;
46+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//// [exportNonInitializedVariablesAMD.ts]
2+
3+
var;
4+
let;
5+
const;
6+
7+
export var a;
8+
export let b;
9+
export var c: string;
10+
export let d: number;
11+
class A {}
12+
export var e: A;
13+
export let f: A;
14+
15+
namespace B {
16+
export let a = 1, b, c = 2;
17+
export let x, y, z;
18+
}
19+
20+
module C {
21+
export var a = 1, b, c = 2;
22+
export var x, y, z;
23+
}
24+
25+
// Shouldn't be filtered
26+
export var a1 = 1;
27+
export let b1 = 1;
28+
export var c1: string = 'a';
29+
export let d1: number = 1;
30+
class D {}
31+
export var e1 = new D;
32+
export let f1 = new D;
33+
export var g1: D = new D;
34+
export let h1: D = new D;
35+
36+
37+
//// [exportNonInitializedVariablesAMD.js]
38+
define(["require", "exports"], function (require, exports) {
39+
var ;
40+
let;
41+
var ;
42+
var A = (function () {
43+
function A() {
44+
}
45+
return A;
46+
})();
47+
var B;
48+
(function (B) {
49+
B.a = 1, B.c = 2;
50+
})(B || (B = {}));
51+
var C;
52+
(function (C) {
53+
C.a = 1, C.c = 2;
54+
})(C || (C = {}));
55+
// Shouldn't be filtered
56+
exports.a1 = 1;
57+
exports.b1 = 1;
58+
exports.c1 = 'a';
59+
exports.d1 = 1;
60+
var D = (function () {
61+
function D() {
62+
}
63+
return D;
64+
})();
65+
exports.e1 = new D;
66+
exports.f1 = new D;
67+
exports.g1 = new D;
68+
exports.h1 = new D;
69+
});
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(2,4): error TS1123: Variable declaration list cannot be empty.
2+
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(3,1): error TS2304: Cannot find name 'let'.
3+
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(4,6): error TS1123: Variable declaration list cannot be empty.
4+
5+
6+
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts (3 errors) ====
7+
8+
var;
9+
10+
!!! error TS1123: Variable declaration list cannot be empty.
11+
let;
12+
~~~
13+
!!! error TS2304: Cannot find name 'let'.
14+
const;
15+
16+
!!! error TS1123: Variable declaration list cannot be empty.
17+
18+
export var a;
19+
export let b;
20+
export var c: string;
21+
export let d: number;
22+
class A {}
23+
export var e: A;
24+
export let f: A;
25+
26+
namespace B {
27+
export let a = 1, b, c = 2;
28+
export let x, y, z;
29+
}
30+
31+
module C {
32+
export var a = 1, b, c = 2;
33+
export var x, y, z;
34+
}
35+
36+
// Shouldn't be filtered
37+
export var a1 = 1;
38+
export let b1 = 1;
39+
export var c1: string = 'a';
40+
export let d1: number = 1;
41+
class D {}
42+
export var e1 = new D;
43+
export let f1 = new D;
44+
export var g1: D = new D;
45+
export let h1: D = new D;
46+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//// [exportNonInitializedVariablesCommonJS.ts]
2+
3+
var;
4+
let;
5+
const;
6+
7+
export var a;
8+
export let b;
9+
export var c: string;
10+
export let d: number;
11+
class A {}
12+
export var e: A;
13+
export let f: A;
14+
15+
namespace B {
16+
export let a = 1, b, c = 2;
17+
export let x, y, z;
18+
}
19+
20+
module C {
21+
export var a = 1, b, c = 2;
22+
export var x, y, z;
23+
}
24+
25+
// Shouldn't be filtered
26+
export var a1 = 1;
27+
export let b1 = 1;
28+
export var c1: string = 'a';
29+
export let d1: number = 1;
30+
class D {}
31+
export var e1 = new D;
32+
export let f1 = new D;
33+
export var g1: D = new D;
34+
export let h1: D = new D;
35+
36+
37+
//// [exportNonInitializedVariablesCommonJS.js]
38+
var ;
39+
let;
40+
var ;
41+
var A = (function () {
42+
function A() {
43+
}
44+
return A;
45+
})();
46+
var B;
47+
(function (B) {
48+
B.a = 1, B.c = 2;
49+
})(B || (B = {}));
50+
var C;
51+
(function (C) {
52+
C.a = 1, C.c = 2;
53+
})(C || (C = {}));
54+
// Shouldn't be filtered
55+
exports.a1 = 1;
56+
exports.b1 = 1;
57+
exports.c1 = 'a';
58+
exports.d1 = 1;
59+
var D = (function () {
60+
function D() {
61+
}
62+
return D;
63+
})();
64+
exports.e1 = new D;
65+
exports.f1 = new D;
66+
exports.g1 = new D;
67+
exports.h1 = new D;

0 commit comments

Comments
 (0)