From be3415a7cb219fe0244e726ccd0f232485672ed6 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 19 Jul 2017 23:13:41 -0400 Subject: Lex and parse explosions --- __tests__/lexer.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '__tests__/lexer.test.js') diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js index b9260b8..3003fb9 100644 --- a/__tests__/lexer.test.js +++ b/__tests__/lexer.test.js @@ -124,4 +124,16 @@ describe('lex', () => { ]) }) }) + + describe('exploding dice', () => { + test('1E1d6', () => { + expect(lex('1E1d6')).toEqual([ + { type: 'constant', value: 1 }, + { type: 'E' }, + { type: 'constant', value: 1 }, + { type: 'd' }, + { type: 'constant', value: 6 } + ]) + }) + }) }) -- cgit v1.2.3