failing test

This commit is contained in:
Wesley Wigham 2015-09-16 15:47:52 -07:00
parent c9170b81a8
commit a2d7b09488
4 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,33 @@
//// [tests/cases/compiler/es3defaultAliasIsQuoted.ts] ////
//// [es3defaultAliasQuoted_file0.ts]
export class Foo {
static CONSTANT = "Foo";
}
export default function assert(value: boolean) {
if (!value) throw new Error("Assertion failed!");
}
//// [es3defaultAliasQuoted_file1.ts]
import {Foo, default as assert} from "./es3defaultAliasQuoted_file0";
assert(Foo.CONSTANT === "Foo");
//// [es3defaultAliasQuoted_file0.js]
var Foo = (function () {
function Foo() {
}
Foo.CONSTANT = "Foo";
return Foo;
})();
exports.Foo = Foo;
function assert(value) {
if (!value)
throw new Error("Assertion failed!");
}
exports.__esModule = true;
exports["default"] = assert;
//// [es3defaultAliasQuoted_file1.js]
var es3defaultAliasQuoted_file0_1 = require("./es3defaultAliasQuoted_file0");
es3defaultAliasQuoted_file0_1["default"](es3defaultAliasQuoted_file0_1.Foo.CONSTANT === "Foo");

View File

@ -0,0 +1,30 @@
=== tests/cases/compiler/es3defaultAliasQuoted_file0.ts ===
export class Foo {
>Foo : Symbol(Foo, Decl(es3defaultAliasQuoted_file0.ts, 0, 0))
static CONSTANT = "Foo";
>CONSTANT : Symbol(Foo.CONSTANT, Decl(es3defaultAliasQuoted_file0.ts, 1, 18))
}
export default function assert(value: boolean) {
>assert : Symbol(assert, Decl(es3defaultAliasQuoted_file0.ts, 3, 1))
>value : Symbol(value, Decl(es3defaultAliasQuoted_file0.ts, 5, 31))
if (!value) throw new Error("Assertion failed!");
>value : Symbol(value, Decl(es3defaultAliasQuoted_file0.ts, 5, 31))
>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11))
}
=== tests/cases/compiler/es3defaultAliasQuoted_file1.ts ===
import {Foo, default as assert} from "./es3defaultAliasQuoted_file0";
>Foo : Symbol(Foo, Decl(es3defaultAliasQuoted_file1.ts, 0, 8))
>default : Symbol(assert, Decl(es3defaultAliasQuoted_file1.ts, 0, 12))
>assert : Symbol(assert, Decl(es3defaultAliasQuoted_file1.ts, 0, 12))
assert(Foo.CONSTANT === "Foo");
>assert : Symbol(assert, Decl(es3defaultAliasQuoted_file1.ts, 0, 12))
>Foo.CONSTANT : Symbol(Foo.CONSTANT, Decl(es3defaultAliasQuoted_file0.ts, 1, 18))
>Foo : Symbol(Foo, Decl(es3defaultAliasQuoted_file1.ts, 0, 8))
>CONSTANT : Symbol(Foo.CONSTANT, Decl(es3defaultAliasQuoted_file0.ts, 1, 18))

View File

@ -0,0 +1,37 @@
=== tests/cases/compiler/es3defaultAliasQuoted_file0.ts ===
export class Foo {
>Foo : Foo
static CONSTANT = "Foo";
>CONSTANT : string
>"Foo" : string
}
export default function assert(value: boolean) {
>assert : (value: boolean) => void
>value : boolean
if (!value) throw new Error("Assertion failed!");
>!value : boolean
>value : boolean
>new Error("Assertion failed!") : Error
>Error : ErrorConstructor
>"Assertion failed!" : string
}
=== tests/cases/compiler/es3defaultAliasQuoted_file1.ts ===
import {Foo, default as assert} from "./es3defaultAliasQuoted_file0";
>Foo : typeof Foo
>default : (value: boolean) => void
>assert : (value: boolean) => void
assert(Foo.CONSTANT === "Foo");
>assert(Foo.CONSTANT === "Foo") : void
>assert : (value: boolean) => void
>Foo.CONSTANT === "Foo" : boolean
>Foo.CONSTANT : string
>Foo : typeof Foo
>CONSTANT : string
>"Foo" : string

View File

@ -0,0 +1,15 @@
// @module: commonjs
// @target: es3
// @Filename: es3defaultAliasQuoted_file0.ts
export class Foo {
static CONSTANT = "Foo";
}
export default function assert(value: boolean) {
if (!value) throw new Error("Assertion failed!");
}
// @Filename: es3defaultAliasQuoted_file1.ts
import {Foo, default as assert} from "./es3defaultAliasQuoted_file0";
assert(Foo.CONSTANT === "Foo");