From 1cc6b80cfd4875f289837421cdbe81e3dfcf0ed1 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sat, 2 Sep 2017 00:47:46 -0400 Subject: Implement repeat --- __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 0c615d5..6745715 100644 --- a/__tests__/lexer.test.js +++ b/__tests__/lexer.test.js @@ -284,4 +284,16 @@ describe('lex', () => { ]) }) }) + + describe('repeat', () => { + test('1d6 x 3', () => { + expect(lex('1d6 x 3')).toEqual([ + { type: 'constant', value: 1 }, + { type: 'd' }, + { type: 'constant', value: 6 }, + { type: ' x ' }, + { type: 'constant', value: 3 } + ]) + }) + }) }) -- cgit v1.2.3