Add more test for import, import equal, module

This commit is contained in:
Yui T 2015-04-08 22:02:33 -07:00
parent 9d29629662
commit 8ad9c0bee7
9 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,22 @@
tests/cases/compiler/strictModeCode6.ts(2,13): error TS1212: Identifier expected. 'package' is a reserved word in strict mode
tests/cases/compiler/strictModeCode6.ts(2,26): error TS2307: Cannot find external module './1'.
tests/cases/compiler/strictModeCode6.ts(3,16): error TS1212: Identifier expected. 'private' is a reserved word in strict mode
tests/cases/compiler/strictModeCode6.ts(3,30): error TS2307: Cannot find external module './1'.
tests/cases/compiler/strictModeCode6.ts(4,20): error TS2307: Cannot find external module './1'.
==== tests/cases/compiler/strictModeCode6.ts (5 errors) ====
"use strict"
import * as package from "./1"
~~~~~~~
!!! error TS1212: Identifier expected. 'package' is a reserved word in strict mode
~~~~~
!!! error TS2307: Cannot find external module './1'.
import {foo as private} from "./1"
~~~~~~~
!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode
~~~~~
!!! error TS2307: Cannot find external module './1'.
import public from "./1"
~~~~~
!!! error TS2307: Cannot find external module './1'.

View file

@ -0,0 +1,8 @@
//// [strictModeCode6.ts]
"use strict"
import * as package from "./1"
import {foo as private} from "./1"
import public from "./1"
//// [strictModeCode6.js]
"use strict";

View file

@ -0,0 +1,12 @@
tests/cases/compiler/strictModeCode7.ts(3,8): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
tests/cases/compiler/strictModeCode7.ts(3,25): error TS2307: Cannot find external module '1'.
==== tests/cases/compiler/strictModeCode7.ts (2 errors) ====
"use strict"
import public = require("1");
~~~~~~
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
~~~
!!! error TS2307: Cannot find external module '1'.

View file

@ -0,0 +1,7 @@
//// [strictModeCode7.ts]
"use strict"
import public = require("1");
//// [strictModeCode7.js]
"use strict";

View file

@ -0,0 +1,12 @@
tests/cases/compiler/strictModeCode8.ts(2,8): error TS1212: Identifier expected. 'public' is a reserved word. Module is automatically in strict mode.
tests/cases/compiler/strictModeCode8.ts(3,8): error TS1212: Identifier expected. 'private' is a reserved word. Module is automatically in strict mode.
==== tests/cases/compiler/strictModeCode8.ts (2 errors) ====
"use strict"
module public { }
~~~~~~
!!! error TS1212: Identifier expected. 'public' is a reserved word. Module is automatically in strict mode.
module private { }
~~~~~~~
!!! error TS1212: Identifier expected. 'private' is a reserved word. Module is automatically in strict mode.

View file

@ -0,0 +1,7 @@
//// [strictModeCode8.ts]
"use strict"
module public { }
module private { }
//// [strictModeCode8.js]
"use strict";

View file

@ -0,0 +1,5 @@
// @target: ES6
"use strict"
import * as package from "./1"
import {foo as private} from "./1"
import public from "./1"

View file

@ -0,0 +1,4 @@
// @module: commonjs
"use strict"
import public = require("1");

View file

@ -0,0 +1,3 @@
"use strict"
module public { }
module private { }