diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:43:38 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:43:38 -0400 |
commit | e7383cc38bf2182e5ab95f30d639fe4a0317fd51 (patch) | |
tree | 5d2ebb3304dc5e7ba16e360c7940e4af4e49b272 /__tests__/parser.test.js | |
parent | 83983efa99d910a97a72fc8b00dd9d7eb8829368 (diff) |
Implement bonus division
Diffstat (limited to '__tests__/parser.test.js')
-rw-r--r-- | __tests__/parser.test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/__tests__/parser.test.js b/__tests__/parser.test.js index 5580b4c..3c9f6ec 100644 --- a/__tests__/parser.test.js +++ b/__tests__/parser.test.js @@ -165,6 +165,18 @@ describe('parse', () => { }) }) + it('parses divisional bonuses', () => { + expect(parse('3d4/1')).toEqual({ + type: 'bonusDivide', + left: { + type: 'd', + left: { type: 'constant', value: 3 }, + right: { type: 'constant', value: 4 } + }, + right: { type: 'constant', value: 1 } + }) + }) + test('bonus binds stronger than addition', () => { expect(parse('2d6 + 2d6+2d6')).toEqual({ type: 'add', |