From 489349e0894a435793b38f18dad7e2dc99bdda96 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Fri, 24 Feb 2017 11:42:08 -0800 Subject: [PATCH] Add new tests and baselines --- .../emitBundleWithPrologueDirectives1.js | 37 +++++++++++++ .../emitBundleWithPrologueDirectives1.symbols | 11 ++++ .../emitBundleWithPrologueDirectives1.types | 11 ++++ ...BundleWithShebangAndPrologueDirectives1.js | 31 +++++++++++ ...eWithShebangAndPrologueDirectives1.symbols | 10 ++++ ...dleWithShebangAndPrologueDirectives1.types | 12 +++++ ...BundleWithShebangAndPrologueDirectives2.js | 53 +++++++++++++++++++ ...eWithShebangAndPrologueDirectives2.symbols | 21 ++++++++ ...dleWithShebangAndPrologueDirectives2.types | 27 ++++++++++ .../emitBundleWithPrologueDirectives1.ts | 10 ++++ ...BundleWithShebangAndPrologueDirectives1.ts | 9 ++++ ...BundleWithShebangAndPrologueDirectives2.ts | 16 ++++++ 12 files changed, 248 insertions(+) create mode 100644 tests/baselines/reference/emitBundleWithPrologueDirectives1.js create mode 100644 tests/baselines/reference/emitBundleWithPrologueDirectives1.symbols create mode 100644 tests/baselines/reference/emitBundleWithPrologueDirectives1.types create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.symbols create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.types create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.symbols create mode 100644 tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.types create mode 100644 tests/cases/compiler/emitBundleWithPrologueDirectives1.ts create mode 100644 tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives1.ts create mode 100644 tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts diff --git a/tests/baselines/reference/emitBundleWithPrologueDirectives1.js b/tests/baselines/reference/emitBundleWithPrologueDirectives1.js new file mode 100644 index 00000000000..07214800aa8 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithPrologueDirectives1.js @@ -0,0 +1,37 @@ +//// [test.ts] +/* Detached Comment */ + +// Class Doo Comment +export class Doo {} +class Scooby extends Doo {} + +//// [outFile.js] +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/* Detached Comment */ +define("test", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // Class Doo Comment + var Doo = (function () { + function Doo() { + } + return Doo; + }()); + exports.Doo = Doo; + var Scooby = (function (_super) { + __extends(Scooby, _super); + function Scooby() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Scooby; + }(Doo)); +}); diff --git a/tests/baselines/reference/emitBundleWithPrologueDirectives1.symbols b/tests/baselines/reference/emitBundleWithPrologueDirectives1.symbols new file mode 100644 index 00000000000..f9e0dea427d --- /dev/null +++ b/tests/baselines/reference/emitBundleWithPrologueDirectives1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/test.ts === +/* Detached Comment */ + +// Class Doo Comment +export class Doo {} +>Doo : Symbol(Doo, Decl(test.ts, 0, 0)) + +class Scooby extends Doo {} +>Scooby : Symbol(Scooby, Decl(test.ts, 3, 19)) +>Doo : Symbol(Doo, Decl(test.ts, 0, 0)) + diff --git a/tests/baselines/reference/emitBundleWithPrologueDirectives1.types b/tests/baselines/reference/emitBundleWithPrologueDirectives1.types new file mode 100644 index 00000000000..8eede161c79 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithPrologueDirectives1.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/test.ts === +/* Detached Comment */ + +// Class Doo Comment +export class Doo {} +>Doo : Doo + +class Scooby extends Doo {} +>Scooby : Scooby +>Doo : Doo + diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js new file mode 100644 index 00000000000..03b6c4a79f9 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js @@ -0,0 +1,31 @@ +//// [test.ts] +#!/usr/bin/env gjs +"use strict" +class Doo {} +class Scooby extends Doo {} + +//// [outFile.js] +#!/usr/bin/env gjs +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var Doo = (function () { + function Doo() { + } + return Doo; +}()); +var Scooby = (function (_super) { + __extends(Scooby, _super); + function Scooby() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Scooby; +}(Doo)); diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.symbols b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.symbols new file mode 100644 index 00000000000..3da4cfdbac0 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/test.ts === +#!/usr/bin/env gjs +"use strict" +class Doo {} +>Doo : Symbol(Doo, Decl(test.ts, 1, 12)) + +class Scooby extends Doo {} +>Scooby : Symbol(Scooby, Decl(test.ts, 2, 12)) +>Doo : Symbol(Doo, Decl(test.ts, 1, 12)) + diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.types b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.types new file mode 100644 index 00000000000..c1f6379c294 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.types @@ -0,0 +1,12 @@ +=== tests/cases/compiler/test.ts === +#!/usr/bin/env gjs +"use strict" +>"use strict" : "use strict" + +class Doo {} +>Doo : Doo + +class Scooby extends Doo {} +>Scooby : Scooby +>Doo : Doo + diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js new file mode 100644 index 00000000000..e469c526779 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js @@ -0,0 +1,53 @@ +//// [tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts] //// + +//// [test.ts] +#!/usr/bin/env gjs +"use strict" +class Doo {} +class Scooby extends Doo {} + +//// [test1.ts] +#!/usr/bin/env gjs +"use strict" +"Another prologue" +class Dood {} +class Scoobyd extends Dood {} + +//// [outFile.js] +#!/usr/bin/env gjs +"use strict"; +"Another prologue"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var Doo = (function () { + function Doo() { + } + return Doo; +}()); +var Scooby = (function (_super) { + __extends(Scooby, _super); + function Scooby() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Scooby; +}(Doo)); +var Dood = (function () { + function Dood() { + } + return Dood; +}()); +var Scoobyd = (function (_super) { + __extends(Scoobyd, _super); + function Scoobyd() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Scoobyd; +}(Dood)); diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.symbols b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.symbols new file mode 100644 index 00000000000..48f90e09b93 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/test.ts === +#!/usr/bin/env gjs +"use strict" +class Doo {} +>Doo : Symbol(Doo, Decl(test.ts, 1, 12)) + +class Scooby extends Doo {} +>Scooby : Symbol(Scooby, Decl(test.ts, 2, 12)) +>Doo : Symbol(Doo, Decl(test.ts, 1, 12)) + +=== tests/cases/compiler/test1.ts === +#!/usr/bin/env gjs +"use strict" +"Another prologue" +class Dood {} +>Dood : Symbol(Dood, Decl(test1.ts, 2, 18)) + +class Scoobyd extends Dood {} +>Scoobyd : Symbol(Scoobyd, Decl(test1.ts, 3, 13)) +>Dood : Symbol(Dood, Decl(test1.ts, 2, 18)) + diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.types b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.types new file mode 100644 index 00000000000..2884e5958e8 --- /dev/null +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/test.ts === +#!/usr/bin/env gjs +"use strict" +>"use strict" : "use strict" + +class Doo {} +>Doo : Doo + +class Scooby extends Doo {} +>Scooby : Scooby +>Doo : Doo + +=== tests/cases/compiler/test1.ts === +#!/usr/bin/env gjs +"use strict" +>"use strict" : "use strict" + +"Another prologue" +>"Another prologue" : "Another prologue" + +class Dood {} +>Dood : Dood + +class Scoobyd extends Dood {} +>Scoobyd : Scoobyd +>Dood : Dood + diff --git a/tests/cases/compiler/emitBundleWithPrologueDirectives1.ts b/tests/cases/compiler/emitBundleWithPrologueDirectives1.ts new file mode 100644 index 00000000000..6117c80dbdb --- /dev/null +++ b/tests/cases/compiler/emitBundleWithPrologueDirectives1.ts @@ -0,0 +1,10 @@ +// @outFile: outFile.js +// @module: amd +// @target: es5 + +// @Filename: test.ts +/* Detached Comment */ + +// Class Doo Comment +export class Doo {} +class Scooby extends Doo {} \ No newline at end of file diff --git a/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives1.ts b/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives1.ts new file mode 100644 index 00000000000..687db159670 --- /dev/null +++ b/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives1.ts @@ -0,0 +1,9 @@ +// @outFile: outFile.js +// @module: amd +// @target: es5 + +// @Filename: test.ts +#!/usr/bin/env gjs +"use strict" +class Doo {} +class Scooby extends Doo {} \ No newline at end of file diff --git a/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts b/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts new file mode 100644 index 00000000000..435cad7c054 --- /dev/null +++ b/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts @@ -0,0 +1,16 @@ +// @outFile: outFile.js +// @module: amd +// @target: es5 + +// @Filename: test.ts +#!/usr/bin/env gjs +"use strict" +class Doo {} +class Scooby extends Doo {} + +// @Filename: test1.ts +#!/usr/bin/env gjs +"use strict" +"Another prologue" +class Dood {} +class Scoobyd extends Dood {} \ No newline at end of file