From 4b1ff742ddb99efaa82653b078813bf478401a30 Mon Sep 17 00:00:00 2001 From: Dan Quirk Date: Mon, 14 Jul 2014 16:47:50 -0700 Subject: [PATCH] Updating some tests for resolved bugs --- .../reference/classExtendingPrimitive2.errors.txt | 11 +++++++++++ .../classExtendsEveryObjectType2.errors.txt | 10 ++++++++++ tests/baselines/reference/duplicateVarAndImport.js | 8 ++++++++ .../reference/duplicateVarAndImport2.errors.txt | 7 +++++++ tests/baselines/reference/duplicateVarAndImport2.js | 13 +++++++++++++ tests/cases/compiler/duplicateVarAndImport.ts | 4 ++++ tests/cases/compiler/duplicateVarAndImport2.ts | 4 ++++ .../classExtendingPrimitive2.ts | 4 ++++ .../classExtendsEveryObjectType2.ts | 3 +++ 9 files changed, 64 insertions(+) create mode 100644 tests/baselines/reference/classExtendingPrimitive2.errors.txt create mode 100644 tests/baselines/reference/classExtendsEveryObjectType2.errors.txt create mode 100644 tests/baselines/reference/duplicateVarAndImport.js create mode 100644 tests/baselines/reference/duplicateVarAndImport2.errors.txt create mode 100644 tests/baselines/reference/duplicateVarAndImport2.js create mode 100644 tests/cases/compiler/duplicateVarAndImport.ts create mode 100644 tests/cases/compiler/duplicateVarAndImport2.ts create mode 100644 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts create mode 100644 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt new file mode 100644 index 0000000000000..9d1f62d535034 --- /dev/null +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== + // classes cannot extend primitives + + class C4a extends void {} + ~~~~ +!!! Identifier expected. + class C5a extends null { } + ~~~~ +!!! Identifier expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt new file mode 100644 index 0000000000000..7a5573ae00054 --- /dev/null +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== + class C2 extends { foo: string; } { } // error + ~ +!!! Identifier expected. + + class C6 extends []{ } // error + ~ +!!! Identifier expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport.js b/tests/baselines/reference/duplicateVarAndImport.js new file mode 100644 index 0000000000000..cc3ff5ad88ca9 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport.js @@ -0,0 +1,8 @@ +//// [duplicateVarAndImport.ts] +// no error since module is not instantiated +var a; +module M {} +import a = M; + +//// [duplicateVarAndImport.js] +var a; diff --git a/tests/baselines/reference/duplicateVarAndImport2.errors.txt b/tests/baselines/reference/duplicateVarAndImport2.errors.txt new file mode 100644 index 0000000000000..b6f52fc23cbe3 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/duplicateVarAndImport2.ts (1 errors) ==== + // error since module is instantiated + var a; + module M { export var x = 1; } + import a = M; + ~~~~~~~~~~~~~ +!!! Import declaration conflicts with local declaration of 'a' \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport2.js b/tests/baselines/reference/duplicateVarAndImport2.js new file mode 100644 index 0000000000000..b0c05f254a6a5 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport2.js @@ -0,0 +1,13 @@ +//// [duplicateVarAndImport2.ts] +// error since module is instantiated +var a; +module M { export var x = 1; } +import a = M; + +//// [duplicateVarAndImport2.js] +var a; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +var a = M; diff --git a/tests/cases/compiler/duplicateVarAndImport.ts b/tests/cases/compiler/duplicateVarAndImport.ts new file mode 100644 index 0000000000000..6817b57bb102e --- /dev/null +++ b/tests/cases/compiler/duplicateVarAndImport.ts @@ -0,0 +1,4 @@ +// no error since module is not instantiated +var a; +module M {} +import a = M; \ No newline at end of file diff --git a/tests/cases/compiler/duplicateVarAndImport2.ts b/tests/cases/compiler/duplicateVarAndImport2.ts new file mode 100644 index 0000000000000..f42b2bcf50bdd --- /dev/null +++ b/tests/cases/compiler/duplicateVarAndImport2.ts @@ -0,0 +1,4 @@ +// error since module is instantiated +var a; +module M { export var x = 1; } +import a = M; \ No newline at end of file diff --git a/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts new file mode 100644 index 0000000000000..58b397cbd84ed --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts @@ -0,0 +1,4 @@ +// classes cannot extend primitives + +class C4a extends void {} +class C5a extends null { } \ No newline at end of file diff --git a/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts new file mode 100644 index 0000000000000..095c0a1154475 --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts @@ -0,0 +1,3 @@ +class C2 extends { foo: string; } { } // error + +class C6 extends []{ } // error \ No newline at end of file