Skip to content

Commit 80db03e

Browse files
author
Arthur Ozga
committed
Added a regex test
1 parent 45ddfa7 commit 80db03e

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
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.
2+
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,22): error TS1109: Expression expected.
3+
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.
4+
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.
5+
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,26): error TS1109: Expression expected.
6+
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.
7+
8+
9+
==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts (6 errors) ====
10+
var regex1 = / asdf /;
11+
var regex2 = /**// asdf /;
12+
var regex3 = /**///**/ asdf / // should be a comment line
13+
1;
14+
var regex4 = /**// /**/asdf /;
15+
~~~
16+
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
17+
~
18+
!!! error TS1109: Expression expected.
19+
~~~~~~~
20+
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
21+
var regex5 = /**// asdf/**/ /;
22+
~~~~~~~
23+
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
24+
~
25+
!!! error TS1109: Expression expected.
26+
~~~
27+
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//// [parseRegularExpressionMixedWithComments.ts]
2+
var regex1 = / asdf /;
3+
var regex2 = /**// asdf /;
4+
var regex3 = /**///**/ asdf / // should be a comment line
5+
1;
6+
var regex4 = /**// /**/asdf /;
7+
var regex5 = /**// asdf/**/ /;
8+
9+
//// [parseRegularExpressionMixedWithComments.js]
10+
var regex1 = / asdf /;
11+
var regex2 = / asdf /;
12+
var regex3 = 1;
13+
var regex4 = / / * * /asdf /;
14+
var regex5 = / asdf/ * * / /;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var regex1 = / asdf /;
2+
var regex2 = /**// asdf /;
3+
var regex3 = /**///**/ asdf / // should be a comment line
4+
1;
5+
var regex4 = /**// /**/asdf /;
6+
var regex5 = /**// asdf/**/ /;

0 commit comments

Comments
 (0)