Basic tests

This commit is contained in:
Jason Freeman 2015-02-20 12:22:32 -08:00
parent e0d7734699
commit aa06622695
21 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1,7 @@
//// [for-of1.ts]
var v;
for (v of []) { }
//// [for-of1.js]
var v;
for (v of []) { }

View File

@ -0,0 +1,8 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of1.ts ===
var v;
>v : any
for (v of []) { }
>v : any
>[] : undefined[]

View File

@ -0,0 +1,11 @@
tests/cases/conformance/es6/for-ofStatements/for-of2.ts(1,7): error TS1155: 'const' declarations must be initialized
tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a previously defined constant.
==== tests/cases/conformance/es6/for-ofStatements/for-of2.ts (2 errors) ====
const v;
~
!!! error TS1155: 'const' declarations must be initialized
for (v of []) { }
~
!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a previously defined constant.

View File

@ -0,0 +1,7 @@
//// [for-of2.ts]
const v;
for (v of []) { }
//// [for-of2.js]
const v;
for (v of []) { }

View File

@ -0,0 +1,8 @@
tests/cases/conformance/es6/for-ofStatements/for-of3.ts(2,6): error TS2486: Invalid left-hand side in 'for...of' statement.
==== tests/cases/conformance/es6/for-ofStatements/for-of3.ts (1 errors) ====
var v;
for (v++ of []) { }
~~~
!!! error TS2486: Invalid left-hand side in 'for...of' statement.

View File

@ -0,0 +1,7 @@
//// [for-of3.ts]
var v;
for (v++ of []) { }
//// [for-of3.js]
var v;
for (v++ of []) { }

View File

@ -0,0 +1,9 @@
//// [for-of4.ts]
for (var v of [0]) {
v;
}
//// [for-of4.js]
for (var v of [0]) {
v;
}

View File

@ -0,0 +1,9 @@
//// [for-of5.ts]
for (let v of [0]) {
v;
}
//// [for-of5.js]
for (let v of [0]) {
v;
}

View File

@ -0,0 +1,9 @@
tests/cases/conformance/es6/for-ofStatements/for-of6.ts(1,6): error TS2304: Cannot find name 'v'.
==== tests/cases/conformance/es6/for-ofStatements/for-of6.ts (1 errors) ====
for (v of [0]) {
~
!!! error TS2304: Cannot find name 'v'.
let v;
}

View File

@ -0,0 +1,9 @@
//// [for-of6.ts]
for (v of [0]) {
let v;
}
//// [for-of6.js]
for (v of [0]) {
let v;
}

View File

@ -0,0 +1,8 @@
tests/cases/conformance/es6/for-ofStatements/for-of7.ts(1,1): error TS2304: Cannot find name 'v'.
==== tests/cases/conformance/es6/for-ofStatements/for-of7.ts (1 errors) ====
v;
~
!!! error TS2304: Cannot find name 'v'.
for (let v of [0]) { }

View File

@ -0,0 +1,7 @@
//// [for-of7.ts]
v;
for (let v of [0]) { }
//// [for-of7.js]
v;
for (let v of [0]) { }

View File

@ -0,0 +1,7 @@
//// [for-of8.ts]
v;
for (var v of [0]) { }
//// [for-of8.js]
v;
for (var v of [0]) { }

View File

@ -0,0 +1,3 @@
//@target: ES6
var v;
for (v of []) { }

View File

@ -0,0 +1,3 @@
//@target: ES6
const v;
for (v of []) { }

View File

@ -0,0 +1,3 @@
//@target: ES6
var v;
for (v++ of []) { }

View File

@ -0,0 +1,4 @@
//@target: ES6
for (var v of [0]) {
v;
}

View File

@ -0,0 +1,4 @@
//@target: ES6
for (let v of [0]) {
v;
}

View File

@ -0,0 +1,4 @@
//@target: ES6
for (v of [0]) {
let v;
}

View File

@ -0,0 +1,3 @@
//@target: ES6
v;
for (let v of [0]) { }

View File

@ -0,0 +1,3 @@
//@target: ES6
v;
for (var v of [0]) { }