Adds missing test cases

This commit is contained in:
Tingan Ho 2017-08-02 20:48:31 +02:00
parent d5c24f3cd3
commit f9e85ec091
3 changed files with 48 additions and 56 deletions

View file

@ -1,17 +1,23 @@
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,12): error TS1005: 'finally' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(10,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(11,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(15,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(17,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(19,20): error TS1003: Identifier expected.
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (7 errors) ====
function fn() {
catch(x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.
finally{ } // potential error; can be absorbed by the 'catch'
finally { } // potential error; can be absorbed by the 'catch'
try { }; // missing finally
~
!!! error TS1005: 'finally' expected.
}
function fn2() {
@ -21,22 +27,18 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5):
catch (x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
// no error
try {
}
finally {
}
// error missing try
finally {
finally { } // error missing try
~~~~~~~
!!! error TS1005: 'try' expected.
}
// error missing try
catch (x) {
catch (x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.
}
try { } catch () { } // error missing catch binding
~
!!! error TS1003: Identifier expected.
}

View file

@ -2,26 +2,22 @@
function fn() {
catch(x) { } // error missing try
finally{ } // potential error; can be absorbed by the 'catch'
finally { } // potential error; can be absorbed by the 'catch'
try { }; // missing finally
}
function fn2() {
finally { } // error missing try
catch (x) { } // error missing try
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
// no error
try {
}
finally {
}
finally { } // error missing try
catch (x) { } // error missing try
// error missing try
finally {
}
// error missing try
catch (x) {
}
try { } catch () { } // error missing catch binding
}
//// [invalidTryStatements2.js]
@ -30,6 +26,9 @@ function fn() {
}
catch (x) { } // error missing try
finally { } // potential error; can be absorbed by the 'catch'
try { }
finally { }
; // missing finally
}
function fn2() {
try {
@ -38,19 +37,14 @@ function fn2() {
try {
}
catch (x) { } // error missing try
// no error
try { }
finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
try {
}
finally {
}
// error missing try
finally { } // error missing try
try {
}
finally {
}
// error missing try
try {
}
catch (x) {
}
catch (x) { } // error missing try
try { }
catch () { } // error missing catch binding
}

View file

@ -1,24 +1,20 @@
function fn() {
catch(x) { } // error missing try
finally{ } // potential error; can be absorbed by the 'catch'
finally { } // potential error; can be absorbed by the 'catch'
try { }; // missing finally
}
function fn2() {
finally { } // error missing try
catch (x) { } // error missing try
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
// no error
try {
}
finally {
}
finally { } // error missing try
catch (x) { } // error missing try
// error missing try
finally {
}
// error missing try
catch (x) {
}
try { } catch () { } // error missing catch binding
}