Skip to content

Commit 4a497fb

Browse files
author
Arthur Ozga
committed
update tests to reflect no completion filtering
1 parent 77a2d0e commit 4a497fb

6 files changed

+20
-55
lines changed

tests/cases/fourslash/completionForStringLiteralRelativeImportAllowJSTrue.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
const kinds = ["import_as", "import_equals", "require"];
3434

3535
for (const kind of kinds) {
36-
goTo.marker(kind + "0");
36+
for(let i = 0; i < 2; ++i) {
37+
goTo.marker(kind + i);
3738
verify.completionListContains("f1");
3839
verify.completionListContains("f2");
3940
verify.completionListContains("f3");
@@ -43,13 +44,5 @@ for (const kind of kinds) {
4344
verify.completionListContains("g1");
4445
verify.completionListContains("g2");
4546
verify.not.completionListItemsCountIsGreaterThan(8);
46-
47-
goTo.marker(kind + "1");
48-
verify.completionListContains("f1");
49-
verify.completionListContains("f2");
50-
verify.completionListContains("f3");
51-
verify.completionListContains("f4");
52-
verify.completionListContains("f5");
53-
verify.completionListContains("f6");
54-
verify.not.completionListItemsCountIsGreaterThan(6);
47+
}
5548
}

tests/cases/fourslash/tripleSlashRefPathCompletionAbsolutePaths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path='fourslash.ts' />
22

3-
// Offers completions for absolute paths.
3+
// Exercises completions for absolute paths.
44

55
// @Filename: tests/test0.ts
66
//// /// <reference path="/tests/cases/f/*0*/

tests/cases/fourslash/tripleSlashRefPathCompletionBackandForwardSlash.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,10 @@ verify.completionListContains("d2");
6161
verify.not.completionListItemsCountIsGreaterThan(2);
6262

6363
function testBlock(offset: number, fileName: string, dir: string) {
64-
for (let m = offset; m < offset + 3; ++m) {
64+
for (let m = offset; m < offset + 4; ++m) {
6565
goTo.marker("" + m);
6666
verify.completionListContains(fileName);
6767
verify.completionListContains(dir);
6868
verify.not.completionListItemsCountIsGreaterThan(2);
6969
}
70-
71-
goTo.marker("" + (offset + 3));
72-
verify.completionListContains(fileName);
73-
verify.not.completionListItemsCountIsGreaterThan(1);
7470
}

tests/cases/fourslash/tripleSlashRefPathCompletionContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path='fourslash.ts' />
22

3-
// Exercises for whether completions are performed depending on where the caret is positioned in the ref comment.
3+
// Exercises whether completions are supplied, conditional on the caret position in the ref comment.
44

55
// @Filename: f.ts
66
//// /*f*/
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path='fourslash.ts' />
22

3-
// Exercises relative path completions going up and down 2 directories
4-
// and the use of forward- and back-slashes and combinations thereof.
3+
// Exercises how changes in the basename change the completions offered.
4+
// They should have no effect, as filtering completions is the responsibility of the editor.
55

66
// @Filename: f1.ts
77
//// /*f1*/
@@ -25,21 +25,10 @@
2525
//// /// <reference path="./f1.t/*9*/
2626
//// /// <reference path="./f1.ts/*10*/
2727

28-
for (let m of ["0", "1"]) {
29-
goTo.marker(m);
30-
verify.completionListContains("f1.ts");
31-
verify.completionListContains("f2.ts");
32-
verify.not.completionListItemsCountIsGreaterThan(2);
33-
}
34-
35-
goTo.marker("2");
36-
verify.completionListContains("d");
37-
verify.not.completionListItemsCountIsGreaterThan(1);
38-
39-
40-
41-
for (let m = 3; m < 11; ++m) {
28+
for (let m = 0; m < 11; ++m) {
4229
goTo.marker("" + m);
4330
verify.completionListContains("f1.ts");
44-
verify.not.completionListItemsCountIsGreaterThan(1);
31+
verify.completionListContains("f2.ts");
32+
verify.completionListContains("d");
33+
verify.not.completionListItemsCountIsGreaterThan(3);
4534
}

tests/cases/fourslash/tripleSlashRefPathCompletionRelativePaths.ts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@
1717
// @Filename: d1/d2/test.ts
1818
//// /// <reference path="/*0*/
1919
//// /// <reference path=".//*1*/
20-
2120
//// /// <reference path="./*2*/
22-
2321
//// /// <reference path="../*3*/
22+
//// /// <reference path="d3/*4*/
2423

25-
//// /// <reference path="..//*4*/
26-
//// /// <reference path="..\/*5*/
24+
//// /// <reference path="..//*5*/
25+
//// /// <reference path="..\/*6*/
2726

28-
//// /// <reference path="../..//*6*/
29-
30-
//// /// <reference path="d3/*7*/
27+
//// /// <reference path="../..//*7*/
3128

3229
//// /// <reference path="d3//*8*/
3330
//// /// <reference path="./d3//*9*/
@@ -40,40 +37,30 @@ parentDirCompletions();
4037
childDirCompletions();
4138

4239
function workingDirCompletions() {
43-
for (let m of ["0", "1",]) {
44-
goTo.marker(m);
40+
for (let m = 0; m < 5; ++m) {
41+
goTo.marker("" + m);
4542
verify.completionListContains("h.ts");
4643
verify.completionListContains("d3");
4744
verify.not.completionListItemsCountIsGreaterThan(2);
4845
}
49-
50-
goTo.marker("2");
51-
verify.completionListContains("h.ts");
52-
verify.not.completionListItemsCountIsGreaterThan(1);
53-
54-
goTo.marker("3");
55-
verify.not.completionListItemsCountIsGreaterThan(0);
5646
}
5747

5848
function parentDirCompletions() {
5949

60-
for (let m of ["4", "5"]) {
50+
for (let m of ["5", "6"]) {
6151
goTo.marker(m);
6252
verify.completionListContains("g.ts");
6353
verify.completionListContains("d2");
6454
verify.not.completionListItemsCountIsGreaterThan(2);
6555
}
6656

67-
goTo.marker("6");
57+
goTo.marker("7");
6858
verify.completionListContains("f.ts");
6959
verify.completionListContains("d1");
7060
verify.not.completionListItemsCountIsGreaterThan(2);
7161
}
7262

7363
function childDirCompletions() {
74-
goTo.marker("7");
75-
verify.completionListContains("d3");
76-
verify.not.completionListItemsCountIsGreaterThan(1);
7764

7865
for (let m of ["8", "9"]) {
7966
goTo.marker(m);

0 commit comments

Comments
 (0)