Skip to content

Commit

Permalink
test: check overlapping matches
Browse files Browse the repository at this point in the history
Fix: #28
  • Loading branch information
indutny committed Jun 25, 2020
1 parent 434f1fe commit 49e7446
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
"devDependencies": {
"@types/debug": "0.0.30",
"@types/mocha": "^5.2.7",
"@types/node": "^10.14.10",
"@types/node": "^10.17.26",
"esm": "^3.2.25",
"llparse-test-fixture": "^3.3.1",
"llparse-test-fixture": "^3.3.3",
"mocha": "^7.1.1",
"ts-node": "^8.8.1",
"tslint": "^6.1.0",
"typescript": "^3.5.2"
"typescript": "^3.9.5"
},
"dependencies": {
"bitcode": "^1.2.0",
"debug": "^3.2.6",
"llparse-frontend": "^1.2.1"
"llparse-frontend": "^1.3.0"
}
}
12 changes: 12 additions & 0 deletions test/compiler-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ describe('llparse/Compiler', () => {
await binary.check('abcdabcdabcdabcdabcdabcdabcd.abcd.',
'off=29\noff=34\n');
});

it('should compile overlapping matches', async () => {
const start = p.node('start');

start.match('aab', printOff(p, start));
start.match('aa', start);

start.otherwise(p.error(3, 'Invalid word'));

const binary = build(p, start, 'overlapping-matches');
await binary.check('aaaabaa', 'off=5\n');
});
});

describe('`.peek()`', () => {
Expand Down

0 comments on commit 49e7446

Please sign in to comment.