Skip to content

Commit ac324c4

Browse files
committedNov 11, 2019
test for #17
1 parent cd5b3e0 commit ac324c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎spec/test-scan.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict'
2+
3+
const OnigString = require('..').OnigString
4+
const OnigScanner = require('..').OnigScanner
5+
6+
describe('Scanner', () => {
7+
it('does not throw on PHP regexp from issue #17', () => {
8+
const scanner = new OnigScanner(["(?i)^\\s*(trait)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)"]);
9+
const res = scanner.findNextMatchSync(new OnigString("trait test {\n"), 0);
10+
expect(res.captureIndices[1].start).toBe(0)
11+
})
12+
});

0 commit comments

Comments
 (0)