Update and add test cases

This commit is contained in:
Yui T 2014-12-08 15:38:35 -08:00
parent e9beba783e
commit c1d509a940
23 changed files with 211 additions and 79 deletions

View File

@ -1,14 +1,11 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,12): error TS1127: Invalid character.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1129: Statement expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,19): error TS1005: '(' expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(6,3): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(7,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1109: Expression expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2304: Cannot find name 'bar'.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,12): error TS2304: Cannot find name 'bar'.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (8 errors) ====
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (5 errors) ====
class C {
foo() {
// Make sure we don't think of *bar as the start of a generator method.
@ -16,19 +13,13 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration
!!! error TS1127: Invalid character.
~
!!! error TS1129: Statement expected.
~
!!! error TS1005: '(' expected.
!!! error TS1109: Expression expected.
~
!!! error TS2304: Cannot find name 'a'.
~~~
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
!!! error TS2304: Cannot find name 'bar'.
return bar;
~~~~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~~~
!!! error TS2304: Cannot find name 'bar'.
}
~
!!! error TS1128: Declaration or statement expected.
}
~
!!! error TS1128: Declaration or statement expected.
}

View File

@ -3,15 +3,13 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1129: Statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,33): error TS1138: Parameter declaration expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,36): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1129: Statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character.
@ -43,21 +41,19 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error T
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1129: Statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS1129: Statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,17): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,17): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression.
@ -82,12 +78,13 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error T
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'.
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ====
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (84 errors) ====
declare module "fs" {
export class File {
constructor(filename: string);
@ -136,30 +133,24 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
!!! error TS2304: Cannot find name 'bfs'.
if (retValue != 0) {
~~
!!! error TS1005: ',' expected.
~
!!! error TS1138: Parameter declaration expected.
~
!!! error TS1005: ';' expected.
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~~
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
!!! error TS1005: '=' expected.
return 1;
^
~
!!! error TS1129: Statement expected.
!!! error TS1109: Expression expected.
retValue = bfs.TYPES();
~
!!! error TS1005: ';' expected.
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~~~
!!! error TS2304: Cannot find name 'bfs'.
if (retValue != 0) {
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
~~~~~~~~~~~~~
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
return 1 &&
}
@ -171,25 +162,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
!!! error TS1005: ';' expected.
!!! error TS1002: Unterminated string literal.
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
~~~
!!! error TS2304: Cannot find name 'bfs'.
if (retValue != 0) {
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
~~~~~~~~~~~~~
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
return 1;
}
}
catch (e) {
~~~~~
!!! error TS1005: 'try' expected.
console.log(e);
~~~~~~~
!!! error TS2304: Cannot find name 'console'.
}
finally {
~~~~~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
@ -501,7 +490,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
~
!!! error TS1005: ';' expected.
~
!!! error TS1129: Statement expected.
!!! error TS1109: Expression expected.
~~~~~~~~~
!!! error TS2304: Cannot find name 'Overloads'.
~~~~~~
@ -510,12 +499,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
!!! error TS2304: Cannot find name 'string'.
public DefaultValue(value?: string = "Hello") { }
~~~~~~
!!! error TS1129: Statement expected.
~~~~~~~~~~~~
!!! error TS1005: ';' expected.
~
!!! error TS1109: Expression expected.
~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2304: Cannot find name 'public'.
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'DefaultValue'.
~~~~~

View File

@ -0,0 +1,10 @@
tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts(1,9): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts(1,12): error TS2304: Cannot find name 'b'.
==== tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts (2 errors) ====
var v = || b;
~~
!!! error TS1109: Expression expected.
~
!!! error TS2304: Cannot find name 'b'.

View File

@ -0,0 +1,12 @@
//// [parserAmbiguityWithBinaryOperator1.ts]
function f1() {
var a, b, c;
if (a < b || b > (c + 1)) { }
}
//// [parserAmbiguityWithBinaryOperator1.js]
function f1() {
var a, b, c;
if (a < b || b > (c + 1)) {
}
}

View File

@ -0,0 +1,20 @@
=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts ===
function f1() {
>f1 : () => void
var a, b, c;
>a : any
>b : any
>c : any
if (a < b || b > (c + 1)) { }
>a < b || b > (c + 1) : boolean
>a < b : boolean
>a : any
>b : any
>b > (c + 1) : boolean
>b : any
>(c + 1) : any
>c + 1 : any
>c : any
}

View File

@ -0,0 +1,12 @@
//// [parserAmbiguityWithBinaryOperator2.ts]
function f() {
var a, b, c;
if (a < b && b > (c + 1)) { }
}
//// [parserAmbiguityWithBinaryOperator2.js]
function f() {
var a, b, c;
if (a < b && b > (c + 1)) {
}
}

View File

@ -0,0 +1,20 @@
=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts ===
function f() {
>f : () => void
var a, b, c;
>a : any
>b : any
>c : any
if (a < b && b > (c + 1)) { }
>a < b && b > (c + 1) : boolean
>a < b : boolean
>a : any
>b : any
>b > (c + 1) : boolean
>b : any
>(c + 1) : any
>c + 1 : any
>c : any
}

View File

@ -0,0 +1,13 @@
//// [parserAmbiguityWithBinaryOperator3.ts]
function f() {
var a, b, c;
if (a < b && b < (c + 1)) { }
}
//// [parserAmbiguityWithBinaryOperator3.js]
function f() {
var a, b, c;
if (a < b && b < (c + 1)) {
}
}

View File

@ -0,0 +1,21 @@
=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts ===
function f() {
>f : () => void
var a, b, c;
>a : any
>b : any
>c : any
if (a < b && b < (c + 1)) { }
>a < b && b < (c + 1) : boolean
>a < b : boolean
>a : any
>b : any
>b < (c + 1) : boolean
>b : any
>(c + 1) : any
>c + 1 : any
>c : any
}

View File

@ -0,0 +1,10 @@
tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts(3,9): error TS2347: Untyped function calls may not accept type arguments.
==== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts (1 errors) ====
function g() {
var a, b, c;
if (a<b, b>(c + 1)) { }
~~~~~~~~~~~~~~
!!! error TS2347: Untyped function calls may not accept type arguments.
}

View File

@ -0,0 +1,12 @@
//// [parserAmbiguityWithBinaryOperator4.ts]
function g() {
var a, b, c;
if (a<b, b>(c + 1)) { }
}
//// [parserAmbiguityWithBinaryOperator4.js]
function g() {
var a, b, c;
if (a(c + 1)) {
}
}

View File

@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,38): error TS1134: Variable declaration expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,60): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,70): error TS1128: Declaration or statement expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,70): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,9): error TS2304: Cannot find name '$'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,31): error TS2304: Cannot find name 'any'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,50): error TS2304: Cannot find name 'any'.
@ -15,7 +15,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMember
~
!!! error TS1005: ';' expected.
~
!!! error TS1128: Declaration or statement expected.
!!! error TS1109: Expression expected.
~
!!! error TS2304: Cannot find name '$'.
~~~

View File

@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts(2,5): error TS1129: Statement expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts(2,5): error TS1127: Invalid character.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts (1 errors) ====
function f() {
|
~
!!! error TS1129: Statement expected.
#
!!! error TS1127: Invalid character.
return;
}

View File

@ -1,19 +1,22 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(2,4): error TS1128: Declaration or statement expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(5,4): error TS1128: Declaration or statement expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(2,4): error TS1127: Invalid character.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(5,4): error TS1127: Invalid character.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(7,4): error TS1127: Invalid character.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(7,5): error TS1005: '}' expected.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts (3 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts (4 errors) ====
module M {
|
~
!!! error TS1128: Declaration or statement expected.
#
!!! error TS1127: Invalid character.
class C {
}
|
~
!!! error TS1128: Declaration or statement expected.
@
!!! error TS1127: Invalid character.
enum E {
}
#
!!! error TS1127: Invalid character.
!!! error TS1005: '}' expected.

View File

@ -1,8 +1,8 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts(1,14): error TS1138: Parameter declaration expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts(1,14): error TS1127: Invalid character.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts (1 errors) ====
function f(a,|) {
~
!!! error TS1138: Parameter declaration expected.
function f(a,#) {
!!! error TS1127: Invalid character.
}

View File

@ -1,7 +1,7 @@
module M {
|
#
class C {
}
|
@
enum E {
}
#

View File

@ -0,0 +1,4 @@
function f1() {
var a, b, c;
if (a < b || b > (c + 1)) { }
}

View File

@ -0,0 +1,4 @@
function f() {
var a, b, c;
if (a < b && b > (c + 1)) { }
}

View File

@ -0,0 +1,4 @@
function f() {
var a, b, c;
if (a < b && b < (c + 1)) { }
}

View File

@ -0,0 +1,4 @@
function g() {
var a, b, c;
if (a<b, b>(c + 1)) { }
}