From e8a1f16e623cfabe593a765cf5f147ea94fb7e44 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 2 Jul 2015 12:20:20 -0700 Subject: [PATCH] Added tests for index signature completion builders. --- .../completionListInIndexSignature01.ts | 20 +++++++++++++++++++ .../completionListInIndexSignature02.ts | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tests/cases/fourslash/completionListInIndexSignature01.ts create mode 100644 tests/cases/fourslash/completionListInIndexSignature02.ts diff --git a/tests/cases/fourslash/completionListInIndexSignature01.ts b/tests/cases/fourslash/completionListInIndexSignature01.ts new file mode 100644 index 00000000000..2db28505b3e --- /dev/null +++ b/tests/cases/fourslash/completionListInIndexSignature01.ts @@ -0,0 +1,20 @@ +/// + +////interface I { +//// [/*1*/]: T; +//// [/*2*/]: T; +////} +//// +////class C { +//// [/*3*/]: string; +//// [str/*4*/: string]: number; +////} +//// +////type T = { +//// [x/*5*/yz: number]: boolean; +//// [/*6*/ + +for (let marker of test.markers()) { + goTo.position(marker.position); + verify.completionListAllowsNewIdentifier(); +} \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInIndexSignature02.ts b/tests/cases/fourslash/completionListInIndexSignature02.ts new file mode 100644 index 00000000000..d3b65dc7759 --- /dev/null +++ b/tests/cases/fourslash/completionListInIndexSignature02.ts @@ -0,0 +1,19 @@ +/// + +////interface I { +//// [x: /*1*/]: T; +//// [: /*2*/]: T +////} +//// +////class C { +//// [a: /*3*/]: string; +//// [str: string/*4*/]: number; +////} +//// +////type T = { +//// [xyz: /*5*/ + +for (let marker of test.markers()) { + goTo.position(marker.position); + verify.not.completionListAllowsNewIdentifier(); +} \ No newline at end of file