diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:29:24 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:29:24 -0400 |
commit | 83983efa99d910a97a72fc8b00dd9d7eb8829368 (patch) | |
tree | 17ac7dbb2332bdc7a5005264c591e894e674b0cf /__tests__/parser.test.js | |
parent | fb5cf866c56184dd615e4b7ec5cf6ed1a4703903 (diff) |
Implement multiplicative bonuses
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 d696b3e..5580b4c 100644 --- a/__tests__/parser.test.js +++ b/__tests__/parser.test.js @@ -153,6 +153,18 @@ describe('parse', () => { }) }) + it('parses multiplicative bonuses', () => { + expect(parse('3d4*1')).toEqual({ + type: 'bonusMultiply', + 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', |