Add tests
This commit is contained in:
parent
61a5bfb09d
commit
a6e4e04bd9
8 changed files with 122 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
tests/cases/compiler/es6ImportNameSpaceImportMergeErrors_1.ts(4,13): error TS2300: Duplicate identifier 'nameSpaceBinding1'.
|
||||
tests/cases/compiler/es6ImportNameSpaceImportMergeErrors_1.ts(5,13): error TS2300: Duplicate identifier 'nameSpaceBinding1'.
|
||||
tests/cases/compiler/es6ImportNameSpaceImportMergeErrors_1.ts(7,8): error TS2440: Import declaration conflicts with local declaration of 'nameSpaceBinding3'
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportNameSpaceImportMergeErrors_0.ts (0 errors) ====
|
||||
|
||||
export var a = 10;
|
||||
|
||||
==== tests/cases/compiler/es6ImportNameSpaceImportMergeErrors_1.ts (3 errors) ====
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportMergeErrors_0";
|
||||
interface nameSpaceBinding { } // this should be ok
|
||||
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'nameSpaceBinding1'.
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'nameSpaceBinding1'.
|
||||
|
||||
import * as nameSpaceBinding3 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2440: Import declaration conflicts with local declaration of 'nameSpaceBinding3'
|
||||
var nameSpaceBinding3 = 10;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//// [tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts] ////
|
||||
|
||||
//// [es6ImportNameSpaceImportMergeErrors_0.ts]
|
||||
|
||||
export var a = 10;
|
||||
|
||||
//// [es6ImportNameSpaceImportMergeErrors_1.ts]
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportMergeErrors_0";
|
||||
interface nameSpaceBinding { } // this should be ok
|
||||
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
|
||||
import * as nameSpaceBinding3 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
var nameSpaceBinding3 = 10;
|
||||
|
||||
|
||||
//// [es6ImportNameSpaceImportMergeErrors_0.js]
|
||||
exports.a = 10;
|
||||
//// [es6ImportNameSpaceImportMergeErrors_1.js]
|
||||
var nameSpaceBinding3 = 10;
|
|
@ -0,0 +1,14 @@
|
|||
//// [tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports.ts] ////
|
||||
|
||||
//// [es6ImportNameSpaceImportNoNamedExports_0.ts]
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
//// [es6ImportNameSpaceImportNoNamedExports_1.ts]
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportNoNamedExports_0"; // error
|
||||
|
||||
//// [es6ImportNameSpaceImportNoNamedExports_0.js]
|
||||
var a = 10;
|
||||
module.exports = a;
|
||||
//// [es6ImportNameSpaceImportNoNamedExports_1.js]
|
|
@ -0,0 +1,12 @@
|
|||
=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_0.ts ===
|
||||
|
||||
var a = 10;
|
||||
>a : number
|
||||
|
||||
export = a;
|
||||
>a : number
|
||||
|
||||
=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_1.ts ===
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportNoNamedExports_0"; // error
|
||||
>nameSpaceBinding : typeof nameSpaceBinding
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
tests/cases/compiler/es6ImportNamedImportNoNamedExports_1.ts(1,10): error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoNamedExports_0"' has no exported member 'a'.
|
||||
tests/cases/compiler/es6ImportNamedImportNoNamedExports_1.ts(2,10): error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoNamedExports_0"' has no exported member 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImportNoNamedExports_0.ts (0 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImportNoNamedExports_1.ts (2 errors) ====
|
||||
import { a } from "es6ImportNamedImportNoNamedExports_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoNamedExports_0"' has no exported member 'a'.
|
||||
import { a as x } from "es6ImportNamedImportNoNamedExports_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoNamedExports_0"' has no exported member 'a'.
|
15
tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts
Normal file
15
tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
// @target: es5
|
||||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportNameSpaceImportMergeErrors_0.ts
|
||||
export var a = 10;
|
||||
|
||||
// @filename: es6ImportNameSpaceImportMergeErrors_1.ts
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportMergeErrors_0";
|
||||
interface nameSpaceBinding { } // this should be ok
|
||||
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
import * as nameSpaceBinding1 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
|
||||
import * as nameSpaceBinding3 from "es6ImportNameSpaceImportMergeErrors_0"; // should be error
|
||||
var nameSpaceBinding3 = 10;
|
|
@ -0,0 +1,9 @@
|
|||
// @target: es5
|
||||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportNameSpaceImportNoNamedExports_0.ts
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
// @filename: es6ImportNameSpaceImportNoNamedExports_1.ts
|
||||
import * as nameSpaceBinding from "es6ImportNameSpaceImportNoNamedExports_0"; // error
|
10
tests/cases/compiler/es6ImportNamedImportNoNamedExports.ts
Normal file
10
tests/cases/compiler/es6ImportNamedImportNoNamedExports.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
// @target: es5
|
||||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportNamedImportNoNamedExports_0.ts
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
// @filename: es6ImportNamedImportNoNamedExports_1.ts
|
||||
import { a } from "es6ImportNamedImportNoNamedExports_0";
|
||||
import { a as x } from "es6ImportNamedImportNoNamedExports_0";
|
Loading…
Reference in a new issue