Adding testcase for the incorrect eliding of the import declarations

This commit is contained in:
Sheetal Nandi 2014-11-11 23:38:18 -08:00
parent a54f974a30
commit ce51343e73
3 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,26 @@
//// [tests/cases/compiler/elidingImportNames.ts] ////
//// [elidingImportNames_test.ts]
import a = require('elidingImportNames_main'); // alias used in typeof
var b = a;
var x: typeof a;
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
var b2 = a2;
//// [elidingImportNames_main.ts]
export var main = 10;
//// [elidingImportNames_main1.ts]
export var main = 10;
//// [elidingImportNames_main.js]
exports.main = 10;
//// [elidingImportNames_main1.js]
exports.main = 10;
//// [elidingImportNames_test.js]
var b = a;
var x;
var a2 = require('elidingImportNames_main1'); // alias not used in typeof
var b2 = a2;

View file

@ -0,0 +1,29 @@
=== tests/cases/compiler/elidingImportNames_test.ts ===
import a = require('elidingImportNames_main'); // alias used in typeof
>a : typeof a
var b = a;
>b : typeof a
>a : typeof a
var x: typeof a;
>x : typeof a
>a : typeof a
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
>a2 : typeof a2
var b2 = a2;
>b2 : typeof a2
>a2 : typeof a2
=== tests/cases/compiler/elidingImportNames_main.ts ===
export var main = 10;
>main : number
=== tests/cases/compiler/elidingImportNames_main1.ts ===
export var main = 10;
>main : number

View file

@ -0,0 +1,15 @@
// @module: commonjs
// @Filename: elidingImportNames_test.ts
import a = require('elidingImportNames_main'); // alias used in typeof
var b = a;
var x: typeof a;
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
var b2 = a2;
// @Filename: elidingImportNames_main.ts
export var main = 10;
// @Filename: elidingImportNames_main1.ts
export var main = 10;