From be26d417a3dea206b6dbd121e762c2ddd7ab0cd1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 2 Apr 2015 17:50:11 -0700 Subject: [PATCH] Add additional tests. --- .../classExpressionWithStaticProperties1.errors.txt | 7 +++++++ .../reference/classExpressionWithStaticProperties1.js | 11 +++++++++++ .../classExpressionWithStaticProperties2.errors.txt | 7 +++++++ .../reference/classExpressionWithStaticProperties2.js | 10 ++++++++++ ...classExpressionWithStaticPropertiesES62.errors.txt | 7 +++++++ .../classExpressionWithStaticPropertiesES62.js | 9 +++++++++ .../compiler/classExpressionWithStaticProperties1.ts | 1 + .../compiler/classExpressionWithStaticProperties2.ts | 1 + .../classExpressionWithStaticPropertiesES62.ts | 2 ++ 9 files changed, 55 insertions(+) create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.js create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.js create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.js create mode 100644 tests/cases/compiler/classExpressionWithStaticProperties1.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticProperties2.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt new file mode 100644 index 00000000000..28e42dd33f1 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties1.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties1.ts (1 errors) ==== + var v = class C { static a = 1; static b = 2 }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.js b/tests/baselines/reference/classExpressionWithStaticProperties1.js new file mode 100644 index 00000000000..344dbff50ed --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.js @@ -0,0 +1,11 @@ +//// [classExpressionWithStaticProperties1.ts] +var v = class C { static a = 1; static b = 2 }; + +//// [classExpressionWithStaticProperties1.js] +var v = (function () { + function C() { + } + C.a = 1; + C.b = 2; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt new file mode 100644 index 00000000000..9a915f70193 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties2.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties2.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.js b/tests/baselines/reference/classExpressionWithStaticProperties2.js new file mode 100644 index 00000000000..9ff9c06ffe4 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.js @@ -0,0 +1,10 @@ +//// [classExpressionWithStaticProperties2.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticProperties2.js] +var v = (function () { + function C() { + } + C.a = 1; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt new file mode 100644 index 00000000000..bed4b2c01aa --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js new file mode 100644 index 00000000000..1efa56ecaa2 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js @@ -0,0 +1,9 @@ +//// [classExpressionWithStaticPropertiesES62.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticPropertiesES62.js] +var v = (_a = class C { + }, + _a.a = 1, + _a); +var _a; diff --git a/tests/cases/compiler/classExpressionWithStaticProperties1.ts b/tests/cases/compiler/classExpressionWithStaticProperties1.ts new file mode 100644 index 00000000000..19fe035e6a7 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticProperties1.ts @@ -0,0 +1 @@ +var v = class C { static a = 1; static b = 2 }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticProperties2.ts b/tests/cases/compiler/classExpressionWithStaticProperties2.ts new file mode 100644 index 00000000000..f7b9606b6e0 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticProperties2.ts @@ -0,0 +1 @@ +var v = class C { static a = 1; static b }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts b/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts new file mode 100644 index 00000000000..ee0430eb793 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts @@ -0,0 +1,2 @@ +//@target: es6 +var v = class C { static a = 1; static b }; \ No newline at end of file