Update tests

This commit is contained in:
Andy Hanson 2016-06-03 09:29:21 -07:00
parent 4281bf5752
commit 8b0974a77e
16 changed files with 32 additions and 125 deletions

View file

@ -1,9 +0,0 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,13): error TS2304: Cannot find name 'b'.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ====
var v = (a: b,) => {
~
!!! error TS2304: Cannot find name 'b'.
};

View file

@ -1,8 +0,0 @@
//// [ArrowFunction2.ts]
var v = (a: b,) => {
};
//// [ArrowFunction2.js]
var v = function (a) {
};

View file

@ -1,16 +0,0 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList5.ts(2,4): error TS2304: Cannot find name 'bar'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList5.ts(2,8): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList5.ts(2,9): error TS1009: Trailing comma not allowed.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList5.ts (3 errors) ====
function foo() {
bar(a,)
~~~
!!! error TS2304: Cannot find name 'bar'.
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS1009: Trailing comma not allowed.
return;
}

View file

@ -1,11 +0,0 @@
//// [parserErrorRecovery_ArgumentList5.ts]
function foo() {
bar(a,)
return;
}
//// [parserErrorRecovery_ArgumentList5.js]
function foo() {
bar(a);
return;
}

View file

@ -1,12 +0,0 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction2.ts(1,13): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction2.ts(1,14): error TS1009: Trailing comma not allowed.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction2.ts (2 errors) ====
var v = (a: b,) => {
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS1009: Trailing comma not allowed.
};

View file

@ -1,8 +0,0 @@
//// [parserX_ArrowFunction2.ts]
var v = (a: b,) => {
};
//// [parserX_ArrowFunction2.js]
var v = function (a) {
};

View file

@ -2,8 +2,19 @@
function f1(x,) {}
f1(1,);
function f2(...args,) {}
f2(...[],);
//// [trailingCommasInFunctionParametersAndArguments.js]
function f1(x) { }
f1(1);
function f2() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
}
f2.apply(void 0, []);

View file

@ -6,3 +6,10 @@ function f1(x,) {}
f1(1,);
>f1 : Symbol(f1, Decl(trailingCommasInFunctionParametersAndArguments.ts, 0, 0))
function f2(...args,) {}
>f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 2, 7))
>args : Symbol(args, Decl(trailingCommasInFunctionParametersAndArguments.ts, 4, 12))
f2(...[],);
>f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 2, 7))

View file

@ -8,3 +8,13 @@ f1(1,);
>f1 : (x: any) => void
>1 : number
function f2(...args,) {}
>f2 : (...args: any[]) => void
>args : any[]
f2(...[],);
>f2(...[],) : void
>f2 : (...args: any[]) => void
>...[] : undefined
>[] : undefined[]

View file

@ -1,24 +0,0 @@
tests/cases/compiler/trailingSeparatorInFunctionCall.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/trailingSeparatorInFunctionCall.ts(4,7): error TS1009: Trailing comma not allowed.
tests/cases/compiler/trailingSeparatorInFunctionCall.ts(9,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/trailingSeparatorInFunctionCall.ts(9,8): error TS1009: Trailing comma not allowed.
==== tests/cases/compiler/trailingSeparatorInFunctionCall.ts (4 errors) ====
function f(x, y) {
}
f(1, 2, );
~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~
!!! error TS1009: Trailing comma not allowed.
function f2<T>(x: T, y: T) {
}
f2(1, 2, );
~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~
!!! error TS1009: Trailing comma not allowed.

View file

@ -1,18 +0,0 @@
//// [trailingSeparatorInFunctionCall.ts]
function f(x, y) {
}
f(1, 2, );
function f2<T>(x: T, y: T) {
}
f2(1, 2, );
//// [trailingSeparatorInFunctionCall.js]
function f(x, y) {
}
f(1, 2);
function f2(x, y) {
}
f2(1, 2);

View file

@ -1,9 +0,0 @@
function f(x, y) {
}
f(1, 2, );
function f2<T>(x: T, y: T) {
}
f2(1, 2, );

View file

@ -1,3 +1,7 @@
function f1(x,) {}
f1(1,);
function f2(...args,) {}
f2(...[],);