update tests to reflect no completion filtering

This commit is contained in:
Arthur Ozga
2016-10-05 14:53:13 -07:00
parent 77a2d0e11a
commit 4a497fb994
6 changed files with 20 additions and 55 deletions

View File

@@ -33,7 +33,8 @@
const kinds = ["import_as", "import_equals", "require"];
for (const kind of kinds) {
goTo.marker(kind + "0");
for(let i = 0; i < 2; ++i) {
goTo.marker(kind + i);
verify.completionListContains("f1");
verify.completionListContains("f2");
verify.completionListContains("f3");
@@ -43,13 +44,5 @@ for (const kind of kinds) {
verify.completionListContains("g1");
verify.completionListContains("g2");
verify.not.completionListItemsCountIsGreaterThan(8);
goTo.marker(kind + "1");
verify.completionListContains("f1");
verify.completionListContains("f2");
verify.completionListContains("f3");
verify.completionListContains("f4");
verify.completionListContains("f5");
verify.completionListContains("f6");
verify.not.completionListItemsCountIsGreaterThan(6);
}
}

View File

@@ -1,6 +1,6 @@
/// <reference path='fourslash.ts' />
// Offers completions for absolute paths.
// Exercises completions for absolute paths.
// @Filename: tests/test0.ts
//// /// <reference path="/tests/cases/f/*0*/

View File

@@ -61,14 +61,10 @@ verify.completionListContains("d2");
verify.not.completionListItemsCountIsGreaterThan(2);
function testBlock(offset: number, fileName: string, dir: string) {
for (let m = offset; m < offset + 3; ++m) {
for (let m = offset; m < offset + 4; ++m) {
goTo.marker("" + m);
verify.completionListContains(fileName);
verify.completionListContains(dir);
verify.not.completionListItemsCountIsGreaterThan(2);
}
goTo.marker("" + (offset + 3));
verify.completionListContains(fileName);
verify.not.completionListItemsCountIsGreaterThan(1);
}

View File

@@ -1,6 +1,6 @@
/// <reference path='fourslash.ts' />
// Exercises for whether completions are performed depending on where the caret is positioned in the ref comment.
// Exercises whether completions are supplied, conditional on the caret position in the ref comment.
// @Filename: f.ts
//// /*f*/

View File

@@ -1,7 +1,7 @@
/// <reference path='fourslash.ts' />
// Exercises relative path completions going up and down 2 directories
// and the use of forward- and back-slashes and combinations thereof.
// Exercises how changes in the basename change the completions offered.
// They should have no effect, as filtering completions is the responsibility of the editor.
// @Filename: f1.ts
//// /*f1*/
@@ -25,21 +25,10 @@
//// /// <reference path="./f1.t/*9*/
//// /// <reference path="./f1.ts/*10*/
for (let m of ["0", "1"]) {
goTo.marker(m);
verify.completionListContains("f1.ts");
verify.completionListContains("f2.ts");
verify.not.completionListItemsCountIsGreaterThan(2);
}
goTo.marker("2");
verify.completionListContains("d");
verify.not.completionListItemsCountIsGreaterThan(1);
for (let m = 3; m < 11; ++m) {
for (let m = 0; m < 11; ++m) {
goTo.marker("" + m);
verify.completionListContains("f1.ts");
verify.not.completionListItemsCountIsGreaterThan(1);
verify.completionListContains("f2.ts");
verify.completionListContains("d");
verify.not.completionListItemsCountIsGreaterThan(3);
}

View File

@@ -17,17 +17,14 @@
// @Filename: d1/d2/test.ts
//// /// <reference path="/*0*/
//// /// <reference path=".//*1*/
//// /// <reference path="./*2*/
//// /// <reference path="../*3*/
//// /// <reference path="d3/*4*/
//// /// <reference path="..//*4*/
//// /// <reference path="..\/*5*/
//// /// <reference path="..//*5*/
//// /// <reference path="..\/*6*/
//// /// <reference path="../..//*6*/
//// /// <reference path="d3/*7*/
//// /// <reference path="../..//*7*/
//// /// <reference path="d3//*8*/
//// /// <reference path="./d3//*9*/
@@ -40,40 +37,30 @@ parentDirCompletions();
childDirCompletions();
function workingDirCompletions() {
for (let m of ["0", "1",]) {
goTo.marker(m);
for (let m = 0; m < 5; ++m) {
goTo.marker("" + m);
verify.completionListContains("h.ts");
verify.completionListContains("d3");
verify.not.completionListItemsCountIsGreaterThan(2);
}
goTo.marker("2");
verify.completionListContains("h.ts");
verify.not.completionListItemsCountIsGreaterThan(1);
goTo.marker("3");
verify.not.completionListItemsCountIsGreaterThan(0);
}
function parentDirCompletions() {
for (let m of ["4", "5"]) {
for (let m of ["5", "6"]) {
goTo.marker(m);
verify.completionListContains("g.ts");
verify.completionListContains("d2");
verify.not.completionListItemsCountIsGreaterThan(2);
}
goTo.marker("6");
goTo.marker("7");
verify.completionListContains("f.ts");
verify.completionListContains("d1");
verify.not.completionListItemsCountIsGreaterThan(2);
}
function childDirCompletions() {
goTo.marker("7");
verify.completionListContains("d3");
verify.not.completionListItemsCountIsGreaterThan(1);
for (let m of ["8", "9"]) {
goTo.marker(m);