Add more test for import, import equal, module
This commit is contained in:
parent
9d29629662
commit
8ad9c0bee7
9 changed files with 80 additions and 0 deletions
22
tests/baselines/reference/strictModeCode6.errors.txt
Normal file
22
tests/baselines/reference/strictModeCode6.errors.txt
Normal 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'.
|
8
tests/baselines/reference/strictModeCode6.js
Normal file
8
tests/baselines/reference/strictModeCode6.js
Normal 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";
|
12
tests/baselines/reference/strictModeCode7.errors.txt
Normal file
12
tests/baselines/reference/strictModeCode7.errors.txt
Normal 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'.
|
7
tests/baselines/reference/strictModeCode7.js
Normal file
7
tests/baselines/reference/strictModeCode7.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
//// [strictModeCode7.ts]
|
||||||
|
|
||||||
|
"use strict"
|
||||||
|
import public = require("1");
|
||||||
|
|
||||||
|
//// [strictModeCode7.js]
|
||||||
|
"use strict";
|
12
tests/baselines/reference/strictModeCode8.errors.txt
Normal file
12
tests/baselines/reference/strictModeCode8.errors.txt
Normal 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.
|
7
tests/baselines/reference/strictModeCode8.js
Normal file
7
tests/baselines/reference/strictModeCode8.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
//// [strictModeCode8.ts]
|
||||||
|
"use strict"
|
||||||
|
module public { }
|
||||||
|
module private { }
|
||||||
|
|
||||||
|
//// [strictModeCode8.js]
|
||||||
|
"use strict";
|
5
tests/cases/compiler/strictModeCode6.ts
Normal file
5
tests/cases/compiler/strictModeCode6.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// @target: ES6
|
||||||
|
"use strict"
|
||||||
|
import * as package from "./1"
|
||||||
|
import {foo as private} from "./1"
|
||||||
|
import public from "./1"
|
4
tests/cases/compiler/strictModeCode7.ts
Normal file
4
tests/cases/compiler/strictModeCode7.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
// @module: commonjs
|
||||||
|
|
||||||
|
"use strict"
|
||||||
|
import public = require("1");
|
3
tests/cases/compiler/strictModeCode8.ts
Normal file
3
tests/cases/compiler/strictModeCode8.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
"use strict"
|
||||||
|
module public { }
|
||||||
|
module private { }
|
Loading…
Reference in a new issue