Skip to content

Commit 3c469c5

Browse files
author
Kanchalai Tanglertsampan
committed
Add tests
1 parent 728a92e commit 3c469c5

9 files changed

+171
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
2+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
3+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
4+
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
5+
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
6+
7+
8+
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
9+
export class C { }
10+
11+
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
12+
import * from Zero from "./0"
13+
~~~~
14+
!!! error TS1005: 'as' expected.
15+
~~~~
16+
!!! error TS1005: 'from' expected.
17+
~~~~
18+
!!! error TS1141: String literal expected.
19+
~~~~
20+
!!! error TS1005: ';' expected.
21+
~~~~~
22+
!!! error TS1005: ';' expected.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithAMD.ts] ////
2+
3+
//// [0.ts]
4+
export class C { }
5+
6+
//// [1.ts]
7+
import * from Zero from "./0"
8+
9+
//// [0.js]
10+
define(["require", "exports"], function (require, exports) {
11+
"use strict";
12+
exports.__esModule = true;
13+
var C = (function () {
14+
function C() {
15+
}
16+
return C;
17+
}());
18+
exports.C = C;
19+
});
20+
//// [1.js]
21+
define(["require", "exports"], function (require, exports) {
22+
"use strict";
23+
exports.__esModule = true;
24+
from;
25+
"./0";
26+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
2+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
3+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
4+
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
5+
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
6+
7+
8+
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
9+
export class C { }
10+
11+
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
12+
import * from Zero from "./0"
13+
~~~~
14+
!!! error TS1005: 'as' expected.
15+
~~~~
16+
!!! error TS1005: 'from' expected.
17+
~~~~
18+
!!! error TS1141: String literal expected.
19+
~~~~
20+
!!! error TS1005: ';' expected.
21+
~~~~~
22+
!!! error TS1005: ';' expected.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//// [tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithCommonjs.ts] ////
2+
3+
//// [0.ts]
4+
export class C { }
5+
6+
//// [1.ts]
7+
import * from Zero from "./0"
8+
9+
//// [0.js]
10+
"use strict";
11+
exports.__esModule = true;
12+
var C = (function () {
13+
function C() {
14+
}
15+
return C;
16+
}());
17+
exports.C = C;
18+
//// [1.js]
19+
"use strict";
20+
exports.__esModule = true;
21+
var from = require();
22+
from;
23+
"./0";
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
2+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
3+
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
4+
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
5+
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
6+
7+
8+
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
9+
export class C { }
10+
11+
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
12+
import * from Zero from "./0"
13+
~~~~
14+
!!! error TS1005: 'as' expected.
15+
~~~~
16+
!!! error TS1005: 'from' expected.
17+
~~~~
18+
!!! error TS1141: String literal expected.
19+
~~~~
20+
!!! error TS1005: ';' expected.
21+
~~~~~
22+
!!! error TS1005: ';' expected.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//// [tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithSystem.ts] ////
2+
3+
//// [0.ts]
4+
export class C { }
5+
6+
//// [1.ts]
7+
import * from Zero from "./0"
8+
9+
//// [0.js]
10+
System.register([], function (exports_1, context_1) {
11+
"use strict";
12+
var __moduleName = context_1 && context_1.id;
13+
var C;
14+
return {
15+
setters: [],
16+
execute: function () {
17+
C = (function () {
18+
function C() {
19+
}
20+
return C;
21+
}());
22+
exports_1("C", C);
23+
}
24+
};
25+
});
26+
//// [1.js]
27+
System.register([], function (exports_1, context_1) {
28+
"use strict";
29+
var __moduleName = context_1 && context_1.id;
30+
var from;
31+
return {
32+
setters: [],
33+
execute: function () {
34+
from;
35+
"./0";
36+
}
37+
};
38+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @module: amd
2+
// @filename: 0.ts
3+
export class C { }
4+
5+
// @filename: 1.ts
6+
import * from Zero from "./0"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @module: commonjs
2+
// @filename: 0.ts
3+
export class C { }
4+
5+
// @filename: 1.ts
6+
import * from Zero from "./0"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @module: system
2+
// @filename: 0.ts
3+
export class C { }
4+
5+
// @filename: 1.ts
6+
import * from Zero from "./0"

0 commit comments

Comments
 (0)