diff options
Diffstat (limited to '__tests__/parser.test.js')
-rw-r--r-- | __tests__/parser.test.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/__tests__/parser.test.js b/__tests__/parser.test.js index 350af03..873972b 100644 --- a/__tests__/parser.test.js +++ b/__tests__/parser.test.js @@ -127,7 +127,7 @@ describe('parse', () => { }) }) - it('parses dice with keep', () => { + it('parses dice with keep high', () => { expect(parse('1K2d20')).toEqual({ type: 'K', left: { type: 'constant', value: 1 }, @@ -139,6 +139,18 @@ describe('parse', () => { }) }) + it('parses dice with keep low', () => { + expect(parse('1k2d20')).toEqual({ + type: 'k', + left: { type: 'constant', value: 1 }, + right: { + type: 'd', + left: { type: 'constant', value: 2 }, + right: { type: 'constant', value: 20 } + } + }) + }) + it('parses additive bonuses', () => { expect(parse('3d4+1')).toEqual({ type: 'bonusAdd', |