diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-23 20:47:54 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-23 20:47:54 -0400 |
commit | 3a99beea32cda8850022458f39ad640966d1477d (patch) | |
tree | 474826b6c4eb72c54ba10f0167cedc73dffa03c6 /__tests__/parser.test.js | |
parent | d6051158e52db719ae506fc48a45d22975b16a8b (diff) |
Lex and parse again
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 25edbfc..6bf5958 100644 --- a/__tests__/parser.test.js +++ b/__tests__/parser.test.js @@ -199,6 +199,18 @@ describe('parse', () => { }) }) + it('parases dice with again', () => { + expect(parse('10A3d10')).toEqual({ + type: 'A', + left: { type: 'constant', value: 10 }, + right: { + type: 'd', + left: { type: 'constant', value: 3 }, + right: { type: 'constant', value: 10 } + } + }) + }) + describe('parsing parentheses', () => { test('(1d6)d6', () => { expect(parse('(1d6)d6')).toEqual({ |