File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " re2js-legendary" ,
3
- "version" : " 0.1.0 " ,
3
+ "version" : " 0.1.1 " ,
4
4
"description" : " a node v0.10 compatible build of RE2JS" ,
5
- "main" : " index.js " ,
5
+ "main" : " index.cjs " ,
6
6
"scripts" : {
7
7
"lint" : " eslint ." ,
8
8
"test" : " mocha test/**/*.cjs"
Original file line number Diff line number Diff line change @@ -9,4 +9,18 @@ describe('re2js', function() {
9
9
assert . ok ( RE2JS . matches ( 'ab+c' , 'abbbc' ) ) ;
10
10
assert . ok ( ! RE2JS . matches ( 'ab+c' , 'cbbba' ) ) ;
11
11
} ) ;
12
+
13
+ it ( 'should work with regexp' , function ( ) {
14
+ var re = / y e e / ;
15
+ var p = RE2JS . compile ( re . source ) ;
16
+ assert . ok ( p . matches ( 'yee' ) ) ;
17
+ } ) ;
18
+
19
+ it ( 'should work with flags' , function ( ) {
20
+ var re = / y e e / i;
21
+ var flags = re . flags . indexOf ( 'i' ) >= 0 ? RE2JS . CASE_INSENSITIVE : null ;
22
+ var p = RE2JS . compile ( re . source , flags ) ;
23
+ assert . ok ( p . matches ( 'yee' ) ) ;
24
+ assert . ok ( p . matches ( 'YEE' ) ) ;
25
+ } ) ;
12
26
} ) ;
You can’t perform that action at this time.
0 commit comments