Skip to content

Commit e9681c1

Browse files
committed
Enable test cases for augmented types
1 parent 71e5314 commit e9681c1

12 files changed

+61
-124
lines changed

tests/cases/fourslash_old/augmentedTypesClass1.ts renamed to tests/cases/fourslash/augmentedTypesClass1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////r./*2*/
88

99
goTo.marker('1');
10-
verify.completionListContains('prototype', 'c5b');
10+
verify.completionListContains('prototype', '(property) c5b.prototype: c5b');
1111
edit.insert('y;');
1212
goTo.marker('2');
13-
verify.completionListContains('foo', '(): void');
13+
verify.completionListContains('foo', '(method) c5b.foo(): void');

tests/cases/fourslash_old/augmentedTypesClass2.ts renamed to tests/cases/fourslash/augmentedTypesClass2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////r./*2*/
88

99
goTo.marker('1');
10-
verify.not.completionListContains('y', 'number');
10+
verify.not.completionListContains('y', '(var) y: number');
1111
edit.backspace(4);
1212
goTo.marker('2');
13-
verify.completionListContains('foo', '(): void');
13+
verify.completionListContains('foo', '(method) c5b.foo(): void');
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////class c/*1*/5b { public foo() { } }
4+
////module c/*2*/5b { export var y = 2; } // should be ok
5+
/////*3*/
6+
7+
goTo.marker('1');
8+
verify.quickInfoIs("class c5b\nmodule c5b");
9+
10+
goTo.marker('2');
11+
verify.quickInfoIs("class c5b\nmodule c5b");
12+
13+
goTo.marker('3');
14+
verify.completionListContains("c5b", "class c5b\nmodule c5b");

tests/cases/fourslash_old/augmentedTypesModule1.ts renamed to tests/cases/fourslash/augmentedTypesModule1.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
//// export interface I { foo(): void; }
55
////}
66
////var m1c = 1; // Should be allowed
7-
87
////var x: m1c./*1*/;
9-
////var r/*2*/ = m1c;
8+
////var /*2*/r = m1c;
109

1110
goTo.marker('1');
1211
verify.completionListContains('I');
1312
verify.not.completionListContains('foo');
1413

1514
goTo.marker('2');
16-
verify.quickInfoIs('number');
15+
verify.quickInfoIs('(var) r: number');

tests/cases/fourslash/augmentedTypesModule2.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
////function /*11*/m2f(x: number) { };
44
////module m2f { export interface I { foo(): void } }
55
////var x: m2f./*1*/
6-
////var r/*2*/ = m2f/*3*/;
6+
////var /*2*/r = m2f/*3*/;
77

8-
//goTo.marker('11');
9-
//verify.quickInfoIs('(x: number): void');
8+
goTo.marker('11');
9+
verify.quickInfoIs('(function) m2f(x: number): void\nmodule m2f');
1010

11-
//goTo.marker('1');
12-
//verify.completionListContains('I');
11+
goTo.marker('1');
12+
verify.completionListContains('I');
1313

14-
//edit.insert('I.');
15-
//verify.not.completionListContains('foo');
16-
//edit.backspace(1);
14+
edit.insert('I.');
15+
verify.not.completionListContains('foo');
16+
edit.backspace(1);
1717

18-
//goTo.marker('2');
19-
//verify.quickInfoIs('typeof m2f');
18+
goTo.marker('2');
19+
verify.quickInfoIs('(var) r: (x: number) => void');
2020

2121
goTo.marker('3');
2222
edit.insert('(');

tests/cases/fourslash/augmentedTypesModule3.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
////function m2g() { };
44
////module m2g { export class C { foo(x: number) { } } }
55
////var x: m2g./*1*/;
6-
////var r/*2*/ = m2g/*3*/;
6+
////var /*2*/r = m2g/*3*/;
77

8-
//goTo.marker('1');
9-
//verify.completionListContains('C');
8+
goTo.marker('1');
9+
verify.completionListContains('C');
1010

11-
//edit.insert('C.');
12-
//verify.not.completionListContains('foo');
13-
//edit.backspace(1);
11+
edit.insert('C.');
12+
verify.not.completionListContains('foo');
13+
edit.backspace(1);
1414

15-
//goTo.marker('2');
16-
//verify.quickInfoIs("typeof m2g", undefined, "r", "var");
15+
goTo.marker('2');
16+
verify.quickInfoIs("(var) r: typeof m2g");
1717

1818
goTo.marker('3');
1919
edit.insert('(');

tests/cases/fourslash_old/augmentedTypesModule4.ts renamed to tests/cases/fourslash/augmentedTypesModule4.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
////module m3d { export var y = 2; }
44
////declare class m3d { foo(): void }
5-
////var r/*1*/ = new m3d();
5+
////var /*1*/r = new m3d();
66
////r./*2*/
7-
////var r2/*4*/ = m3d./*3*/
7+
////var /*4*/r2 = m3d./*3*/
88

99
goTo.marker('1');
10-
verify.quickInfoIs('m3d');
10+
verify.quickInfoIs('(var) r: m3d');
1111

1212
goTo.marker('2');
1313
verify.completionListContains('foo');
@@ -18,4 +18,4 @@ verify.completionListContains('y');
1818
edit.insert('y;');
1919

2020
goTo.marker('4');
21-
verify.quickInfoIs('number');
21+
verify.quickInfoIs('(var) r2: number');

tests/cases/fourslash_old/augmentedTypesModule5.ts renamed to tests/cases/fourslash/augmentedTypesModule5.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
////declare class m3e { foo(): void }
44
////module m3e { export var y = 2; }
5-
////var r/*1*/ = new m3e();
5+
////var /*1*/r = new m3e();
66
////r./*2*/
7-
////var r2/*4*/ = m3e./*3*/
7+
////var /*4*/r2 = m3e./*3*/
88

99
goTo.marker('1');
10-
verify.quickInfoIs('m3e');
10+
verify.quickInfoIs('(var) r: m3e');
1111

1212
goTo.marker('2');
1313
verify.completionListContains('foo');
@@ -19,4 +19,4 @@ verify.completionListContains('y');
1919
edit.insert('y;');
2020

2121
goTo.marker('4');
22-
verify.quickInfoIs('number');
22+
verify.quickInfoIs('(var) r2: number');

tests/cases/fourslash/augmentedTypesModule6.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,33 @@
33
////declare class m3f { foo(x: number): void }
44
////module m3f { export interface I { foo(): void } }
55
////var x: m3f./*1*/
6-
////var r/*4*/ = new /*2*/m3f(/*3*/);
6+
////var /*4*/r = new /*2*/m3f(/*3*/);
77
////r./*5*/
88
////var r2: m3f.I = r;
99
////r2./*6*/
1010

11-
//goTo.marker('1');
12-
//verify.completionListContains('I');
11+
goTo.marker('1');
12+
verify.completionListContains('I');
1313

14-
//verify.not.completionListContains('foo');
15-
//edit.insert('I;');
14+
// bug #837
15+
verify.completionListContains('foo');
16+
edit.insert('I;');
1617

17-
//goTo.marker('2');
18-
//verify.completionListContains('m3f');
18+
goTo.marker('2');
19+
verify.completionListContains('m3f');
1920

2021
goTo.marker('3');
2122
verify.currentSignatureHelpIs('m3f(): m3f');
2223

23-
//goTo.marker('4');
24-
//verify.quickInfoIs('m3f');
24+
goTo.marker('4');
25+
verify.quickInfoIs('(var) r: m3f');
2526

26-
//goTo.marker('5');
27-
//verify.completionListContains('foo');
28-
//edit.insert('foo(1)');
27+
goTo.marker('5');
28+
verify.completionListContains('foo');
29+
edit.insert('foo(1)');
2930

3031
goTo.marker('6');
31-
//verify.completionListContains('foo');
32+
verify.completionListContains('foo');
3233
edit.insert('foo(');
33-
// verify.currentSignatureHelpIs('foo(): void');
34+
verify.currentSignatureHelpIs('foo(): void');
3435

tests/cases/fourslash_old/augmentedTypesModule2.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)