Add some tests for yield*

This commit is contained in:
Jason Freeman 2015-04-23 13:02:02 -07:00
parent 8aa62b466d
commit 8dac1bf033
12 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,10 @@
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts(1,9): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts (2 errors) ====
yield * [];
~~~~~
!!! error TS2304: Cannot find name 'yield'.
~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.

View file

@ -0,0 +1,5 @@
//// [YieldStarExpression1_es6.ts]
yield * [];
//// [YieldStarExpression1_es6.js]
yield * [];

View file

@ -0,0 +1,10 @@
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts(1,8): error TS1109: Expression expected.
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts (2 errors) ====
yield *;
~~~~~
!!! error TS2304: Cannot find name 'yield'.
~
!!! error TS1109: Expression expected.

View file

@ -0,0 +1,5 @@
//// [YieldStarExpression2_es6.ts]
yield *;
//// [YieldStarExpression2_es6.js]
yield * ;

View file

@ -0,0 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts(2,12): error TS1109: Expression expected.
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts (1 errors) ====
function *g() {
yield *;
~
!!! error TS1109: Expression expected.
}

View file

@ -0,0 +1,9 @@
//// [YieldStarExpression3_es6.ts]
function *g() {
yield *;
}
//// [YieldStarExpression3_es6.js]
function g() {
yield* ;
}

View file

@ -0,0 +1,12 @@
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(1,10): error TS9001: Generators are not currently supported.
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(2,5): error TS9000: 'yield' expressions are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts (2 errors) ====
function *g() {
~
!!! error TS9001: Generators are not currently supported.
yield * [];
~~~~~
!!! error TS9000: 'yield' expressions are not currently supported.
}

View file

@ -0,0 +1,9 @@
//// [YieldStarExpression4_es6.ts]
function *g() {
yield * [];
}
//// [YieldStarExpression4_es6.js]
function g() {
yield* [];
}

View file

@ -0,0 +1 @@
yield * [];

View file

@ -0,0 +1 @@
yield *;

View file

@ -0,0 +1,3 @@
function *g() {
yield *;
}

View file

@ -0,0 +1,3 @@
function *g() {
yield * [];
}