mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Basic tests
This commit is contained in:
parent
e0d7734699
commit
aa06622695
7
tests/baselines/reference/for-of1.js
Normal file
7
tests/baselines/reference/for-of1.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [for-of1.ts]
|
||||
var v;
|
||||
for (v of []) { }
|
||||
|
||||
//// [for-of1.js]
|
||||
var v;
|
||||
for (v of []) { }
|
||||
8
tests/baselines/reference/for-of1.types
Normal file
8
tests/baselines/reference/for-of1.types
Normal file
@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of1.ts ===
|
||||
var v;
|
||||
>v : any
|
||||
|
||||
for (v of []) { }
|
||||
>v : any
|
||||
>[] : undefined[]
|
||||
|
||||
11
tests/baselines/reference/for-of2.errors.txt
Normal file
11
tests/baselines/reference/for-of2.errors.txt
Normal 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.
|
||||
7
tests/baselines/reference/for-of2.js
Normal file
7
tests/baselines/reference/for-of2.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [for-of2.ts]
|
||||
const v;
|
||||
for (v of []) { }
|
||||
|
||||
//// [for-of2.js]
|
||||
const v;
|
||||
for (v of []) { }
|
||||
8
tests/baselines/reference/for-of3.errors.txt
Normal file
8
tests/baselines/reference/for-of3.errors.txt
Normal 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.
|
||||
7
tests/baselines/reference/for-of3.js
Normal file
7
tests/baselines/reference/for-of3.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [for-of3.ts]
|
||||
var v;
|
||||
for (v++ of []) { }
|
||||
|
||||
//// [for-of3.js]
|
||||
var v;
|
||||
for (v++ of []) { }
|
||||
9
tests/baselines/reference/for-of4.js
Normal file
9
tests/baselines/reference/for-of4.js
Normal file
@ -0,0 +1,9 @@
|
||||
//// [for-of4.ts]
|
||||
for (var v of [0]) {
|
||||
v;
|
||||
}
|
||||
|
||||
//// [for-of4.js]
|
||||
for (var v of [0]) {
|
||||
v;
|
||||
}
|
||||
9
tests/baselines/reference/for-of5.js
Normal file
9
tests/baselines/reference/for-of5.js
Normal file
@ -0,0 +1,9 @@
|
||||
//// [for-of5.ts]
|
||||
for (let v of [0]) {
|
||||
v;
|
||||
}
|
||||
|
||||
//// [for-of5.js]
|
||||
for (let v of [0]) {
|
||||
v;
|
||||
}
|
||||
9
tests/baselines/reference/for-of6.errors.txt
Normal file
9
tests/baselines/reference/for-of6.errors.txt
Normal 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;
|
||||
}
|
||||
9
tests/baselines/reference/for-of6.js
Normal file
9
tests/baselines/reference/for-of6.js
Normal file
@ -0,0 +1,9 @@
|
||||
//// [for-of6.ts]
|
||||
for (v of [0]) {
|
||||
let v;
|
||||
}
|
||||
|
||||
//// [for-of6.js]
|
||||
for (v of [0]) {
|
||||
let v;
|
||||
}
|
||||
8
tests/baselines/reference/for-of7.errors.txt
Normal file
8
tests/baselines/reference/for-of7.errors.txt
Normal 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]) { }
|
||||
7
tests/baselines/reference/for-of7.js
Normal file
7
tests/baselines/reference/for-of7.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [for-of7.ts]
|
||||
v;
|
||||
for (let v of [0]) { }
|
||||
|
||||
//// [for-of7.js]
|
||||
v;
|
||||
for (let v of [0]) { }
|
||||
7
tests/baselines/reference/for-of8.js
Normal file
7
tests/baselines/reference/for-of8.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [for-of8.ts]
|
||||
v;
|
||||
for (var v of [0]) { }
|
||||
|
||||
//// [for-of8.js]
|
||||
v;
|
||||
for (var v of [0]) { }
|
||||
3
tests/cases/conformance/es6/for-ofStatements/for-of1.ts
Normal file
3
tests/cases/conformance/es6/for-ofStatements/for-of1.ts
Normal file
@ -0,0 +1,3 @@
|
||||
//@target: ES6
|
||||
var v;
|
||||
for (v of []) { }
|
||||
3
tests/cases/conformance/es6/for-ofStatements/for-of2.ts
Normal file
3
tests/cases/conformance/es6/for-ofStatements/for-of2.ts
Normal file
@ -0,0 +1,3 @@
|
||||
//@target: ES6
|
||||
const v;
|
||||
for (v of []) { }
|
||||
3
tests/cases/conformance/es6/for-ofStatements/for-of3.ts
Normal file
3
tests/cases/conformance/es6/for-ofStatements/for-of3.ts
Normal file
@ -0,0 +1,3 @@
|
||||
//@target: ES6
|
||||
var v;
|
||||
for (v++ of []) { }
|
||||
4
tests/cases/conformance/es6/for-ofStatements/for-of4.ts
Normal file
4
tests/cases/conformance/es6/for-ofStatements/for-of4.ts
Normal file
@ -0,0 +1,4 @@
|
||||
//@target: ES6
|
||||
for (var v of [0]) {
|
||||
v;
|
||||
}
|
||||
4
tests/cases/conformance/es6/for-ofStatements/for-of5.ts
Normal file
4
tests/cases/conformance/es6/for-ofStatements/for-of5.ts
Normal file
@ -0,0 +1,4 @@
|
||||
//@target: ES6
|
||||
for (let v of [0]) {
|
||||
v;
|
||||
}
|
||||
4
tests/cases/conformance/es6/for-ofStatements/for-of6.ts
Normal file
4
tests/cases/conformance/es6/for-ofStatements/for-of6.ts
Normal file
@ -0,0 +1,4 @@
|
||||
//@target: ES6
|
||||
for (v of [0]) {
|
||||
let v;
|
||||
}
|
||||
3
tests/cases/conformance/es6/for-ofStatements/for-of7.ts
Normal file
3
tests/cases/conformance/es6/for-ofStatements/for-of7.ts
Normal file
@ -0,0 +1,3 @@
|
||||
//@target: ES6
|
||||
v;
|
||||
for (let v of [0]) { }
|
||||
3
tests/cases/conformance/es6/for-ofStatements/for-of8.ts
Normal file
3
tests/cases/conformance/es6/for-ofStatements/for-of8.ts
Normal file
@ -0,0 +1,3 @@
|
||||
//@target: ES6
|
||||
v;
|
||||
for (var v of [0]) { }
|
||||
Loading…
x
Reference in New Issue
Block a user