From 70911a31b656c020558702c8618f7623c5a04c45 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 20 May 2015 14:58:55 -0700 Subject: [PATCH] Adjust tests. --- .../fourslash/findAllRefsForDefault04.ts | 28 +++++++++++++++++++ .../fourslash/findAllRefsForDefault05.ts | 28 +++++++++++++++++++ .../fourslash/findAllRefsForDefault06.ts | 28 +++++++++++++++++++ ...gative02.ts => findAllRefsForDefault07.ts} | 3 ++ ...gative01.ts => findAllRefsForDefault08.ts} | 3 ++ .../findAllRefsForDefaultExportNegative03.ts | 17 ----------- 6 files changed, 90 insertions(+), 17 deletions(-) create mode 100644 tests/cases/fourslash/findAllRefsForDefault04.ts create mode 100644 tests/cases/fourslash/findAllRefsForDefault05.ts create mode 100644 tests/cases/fourslash/findAllRefsForDefault06.ts rename tests/cases/fourslash/{findAllRefsForDefaultExportNegative02.ts => findAllRefsForDefault07.ts} (76%) rename tests/cases/fourslash/{findAllRefsForDefaultExportNegative01.ts => findAllRefsForDefault08.ts} (72%) delete mode 100644 tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts diff --git a/tests/cases/fourslash/findAllRefsForDefault04.ts b/tests/cases/fourslash/findAllRefsForDefault04.ts new file mode 100644 index 00000000000..45b008b55fe --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault04.ts @@ -0,0 +1,28 @@ +/// + +////function f() { +//// return 100; +////} +//// +////export default [|f|]; +//// +////var x: typeof f; +//// +////var y = f(); +//// +////namespace /**/[|f|] { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' +// site is included in the references to the namespace. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefault05.ts b/tests/cases/fourslash/findAllRefsForDefault05.ts new file mode 100644 index 00000000000..6655138da3b --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault05.ts @@ -0,0 +1,28 @@ +/// + +////function /**/[|f|]() { +//// return 100; +////} +//// +////export default [|f|]; +//// +////var x: typeof [|f|]; +//// +////var y = [|f|](); +//// +////namespace f { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' site +// and all value-uses of 'f' are included in the references to the function. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefault06.ts b/tests/cases/fourslash/findAllRefsForDefault06.ts new file mode 100644 index 00000000000..12c187b4b0c --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault06.ts @@ -0,0 +1,28 @@ +/// + +////function [|f|]() { +//// return 100; +////} +//// +////export default /**/[|f|]; +//// +////var x: typeof [|f|]; +//// +////var y = [|f|](); +//// +////namespace [|f|] { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' site +// and all value-uses of 'f' are included in the references to the function. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts b/tests/cases/fourslash/findAllRefsForDefault07.ts similarity index 76% rename from tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts rename to tests/cases/fourslash/findAllRefsForDefault07.ts index 901cc3ffe0f..9534a671316 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts +++ b/tests/cases/fourslash/findAllRefsForDefault07.ts @@ -11,5 +11,8 @@ ////namespace /**/DefaultExportedFunction { ////} +// The namespace and function do not merge, +// so the namespace should be all alone. + goTo.marker(); verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts b/tests/cases/fourslash/findAllRefsForDefault08.ts similarity index 72% rename from tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts rename to tests/cases/fourslash/findAllRefsForDefault08.ts index b44ab76b292..80eabbe53f4 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts +++ b/tests/cases/fourslash/findAllRefsForDefault08.ts @@ -10,5 +10,8 @@ ////namespace /**/DefaultExportedClass { ////} +// The namespace and class do not merge, +// so the namespace should be all alone. + goTo.marker(); verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts b/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts deleted file mode 100644 index d9364b2193e..00000000000 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////function f() { -//// return 100; -////} -//// -////export default f; -//// -////var x: typeof f; -//// -////var y = f(); -//// -////namespace /**/f { -////} - -goTo.marker(); -verify.referencesCountIs(1);