Skip to content

Commit

Permalink
new test, old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KiaraGrouwstra committed Aug 22, 2017
1 parent ddc7c3b commit 74a048a
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 31 deletions.
22 changes: 5 additions & 17 deletions tests/baselines/reference/arrayTypeOfTypeOf.errors.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1005: '(' expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1005: '(' expected.


==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ====
==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (2 errors) ====
// array type cannot use typeof.

var x = 1;
var xs: typeof x[]; // Not an error. This is equivalent to Array<typeof x>
var xs2: typeof Array;
var xs3: typeof Array<number>;
~~~
!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
~
!!! error TS1005: '=' expected.
~
!!! error TS1109: Expression expected.
!!! error TS1005: '(' expected.
var xs4: typeof Array<typeof x>;
~~~
!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
~
!!! error TS1005: '=' expected.
~
!!! error TS1109: Expression expected.
!!! error TS1005: '(' expected.
4 changes: 2 additions & 2 deletions tests/baselines/reference/arrayTypeOfTypeOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ var xs4: typeof Array<typeof x>;
var x = 1;
var xs; // Not an error. This is equivalent to Array<typeof x>
var xs2;
var xs3 = ;
var xs4 = ;
var xs3;
var xs4;
12 changes: 9 additions & 3 deletions tests/baselines/reference/invalidTypeOfTarget.errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(1,16): error TS1003: Identifier expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,16): error TS1003: Identifier expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,24): error TS1005: '=>' expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,18): error TS1005: ',' expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,20): error TS1134: Variable declaration expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,24): error TS1109: Expression expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(3,16): error TS1003: Identifier expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(4,16): error TS1003: Identifier expected.
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(5,16): error TS1003: Identifier expected.
Expand All @@ -12,15 +14,19 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(8,16): error TS1003: Identifier expected.


==== tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts (12 errors) ====
==== tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts (14 errors) ====
var x1: typeof {};
~
!!! error TS1003: Identifier expected.
var x2: typeof (): void;
~
!!! error TS1003: Identifier expected.
~
!!! error TS1005: ',' expected.
~~~~
!!! error TS1134: Variable declaration expected.
~
!!! error TS1005: '=>' expected.
!!! error TS1109: Expression expected.
var x3: typeof 1;
~
!!! error TS1003: Identifier expected.
Expand Down
3 changes: 2 additions & 1 deletion tests/baselines/reference/invalidTypeOfTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var x8: typeof /123/;
//// [invalidTypeOfTarget.js]
var x1 = {};
var x2 = function () { return ; };
var x2;
void ;
var x3 = 1;
var x4 = '';
var x5;
Expand Down
5 changes: 4 additions & 1 deletion tests/baselines/reference/parserObjectType5.errors.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(2,7): error TS2304: Cannot find name 'B'.
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(3,5): error TS2304: Cannot find name 'T'.
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(3,7): error TS1005: '(' expected.


==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts (3 errors) ====
var v: {
A: B
~
!!! error TS2304: Cannot find name 'B'.
<T>;
~
!!! error TS2304: Cannot find name 'T'.
~
!!! error TS1005: '(' expected.
};
9 changes: 3 additions & 6 deletions tests/baselines/reference/parserTypeQuery8.errors.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,15): error TS2304: Cannot find name 'A'.
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,16): error TS1005: '=' expected.
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,17): error TS2304: Cannot find name 'B'.
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,19): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,19): error TS1005: '(' expected.


==== tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts (4 errors) ====
==== tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts (3 errors) ====
var v: typeof A<B>
~
!!! error TS2304: Cannot find name 'A'.
~
!!! error TS1005: '=' expected.
~
!!! error TS2304: Cannot find name 'B'.

!!! error TS1109: Expression expected.
!!! error TS1005: '(' expected.
2 changes: 1 addition & 1 deletion tests/baselines/reference/parserTypeQuery8.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
var v: typeof A<B>

//// [parserTypeQuery8.js]
var v = ;
var v;
2 changes: 2 additions & 0 deletions tests/baselines/reference/typeCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type i = Wrap<123>;

type F5 = () => () => { a: () => 1; };
type j = F5()()['a']();

type k = Id<string>('foo');


//// [typeCall.js]
Expand Down
4 changes: 4 additions & 0 deletions tests/baselines/reference/typeCall.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ type j = F5()()['a']();
>j : Symbol(j, Decl(typeCall.ts, 27, 38))
>F5 : Symbol(F5, Decl(typeCall.ts, 25, 19))

type k = Id<string>('foo');
>k : Symbol(k, Decl(typeCall.ts, 28, 23))
>Id : Symbol(Id, Decl(typeCall.ts, 19, 21))

4 changes: 4 additions & 0 deletions tests/baselines/reference/typeCall.types
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ type j = F5()()['a']();
>j : 1
>F5 : F5

type k = Id<string>('foo');
>k : any
>Id : Id

2 changes: 2 additions & 0 deletions tests/cases/compiler/typeCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ type i = Wrap<123>;

type F5 = () => () => { a: () => 1; };
type j = F5()()['a']();

type k = Id<string>('foo');

0 comments on commit 74a048a

Please sign in to comment.