Added a regex test

This commit is contained in:
Arthur Ozga 2015-07-24 15:28:48 -07:00
parent 45ddfa7c75
commit 80db03efaa
3 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,27 @@
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,18): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,22): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,18): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,26): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,27): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts (6 errors) ====
var regex1 = / asdf /;
var regex2 = /**// asdf /;
var regex3 = /**///**/ asdf / // should be a comment line
1;
var regex4 = /**// /**/asdf /;
~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~
!!! error TS1109: Expression expected.
~~~~~~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
var regex5 = /**// asdf/**/ /;
~~~~~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~
!!! error TS1109: Expression expected.
~~~
!!! 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,14 @@
//// [parseRegularExpressionMixedWithComments.ts]
var regex1 = / asdf /;
var regex2 = /**// asdf /;
var regex3 = /**///**/ asdf / // should be a comment line
1;
var regex4 = /**// /**/asdf /;
var regex5 = /**// asdf/**/ /;
//// [parseRegularExpressionMixedWithComments.js]
var regex1 = / asdf /;
var regex2 = / asdf /;
var regex3 = 1;
var regex4 = / / * * /asdf /;
var regex5 = / asdf/ * * / /;

View file

@ -0,0 +1,6 @@
var regex1 = / asdf /;
var regex2 = /**// asdf /;
var regex3 = /**///**/ asdf / // should be a comment line
1;
var regex4 = /**// /**/asdf /;
var regex5 = /**// asdf/**/ /;