From c22e47d26d65b92bbed9371466de8da4c9d8ce8b Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 7 Dec 2016 17:12:42 -0800 Subject: [PATCH] add test for computed literals --- ...mentedInterfaceComputedPropertyLiterals.ts | 21 +++++++++++++++++++ ...aceComputedPropertyNameWellKnownSymbols.ts | 3 +-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyLiterals.ts diff --git a/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyLiterals.ts b/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyLiterals.ts new file mode 100644 index 00000000000..98f9c978c3d --- /dev/null +++ b/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyLiterals.ts @@ -0,0 +1,21 @@ +/// + +//// interface I { +//// ["foo"](o: any): boolean; +//// ["x"]: boolean; +//// [1](): string; +//// [2]: boolean; +//// } + +//// class C implements I {[| |]} + +verify.rangeAfterCodeFix(` + [1](): string { + throw new Error('Method not implemented.'); + } + [2]: boolean; + ["foo"](o: any): boolean { + throw new Error('Method not implemented.'); + } + ["x"]: boolean; +`); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyNameWellKnownSymbols.ts b/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyNameWellKnownSymbols.ts index ffad13e74de..8a6e7e8f2d8 100644 --- a/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyNameWellKnownSymbols.ts +++ b/tests/cases/fourslash/codeFixUnImplementedInterfaceComputedPropertyNameWellKnownSymbols.ts @@ -5,7 +5,7 @@ //// interface I { //// [Symbol.hasInstance](o: any): boolean; //// [Symbol.isConcatSpreadable]: boolean; -//// [Symbol.iterator](): Iterator; +//// [Symbol.iterator](): any; //// [Symbol.match]: boolean; //// [Symbol.replace](...args); //// [Symbol.search](str: string): number; @@ -20,7 +20,6 @@ //// //// class C implements I {[| |]} - verify.rangeAfterCodeFix(` [Symbol.hasInstance](o: any): boolean { throw new Error('Method not implemented.');