m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-12 22:54:43 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-12 22:54:43 -0400
commit80c3d09308d4d168658ee7af34e026ff37e1e2ce (patch)
tree74a4a0485bacfe1f6fa267d6bfa910c8e6e2e67c /__tests__
parent38e82ade6fd207af21f2df6a3e98298338e85eb8 (diff)
Ignore whitespace
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/lexer.test.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index 20d461f..8d47ff5 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -9,6 +9,20 @@ describe('lex', () => {
expect(lex('q')).toBe('error')
})
+ describe('ignores whitespace', () => {
+ it('2 d 4', () => {
+ expect(lex('2 d 4')).not.toBe('error')
+ })
+
+ it(' 1d8', () => {
+ expect(lex(' 1d8')).not.toBe('error')
+ })
+
+ it('3d4 ', () => {
+ expect(lex('3d4 ')).not.toBe('error')
+ })
+ })
+
describe('basic dice', () => {
it('1d6', () => {
expect(lex('1d6')).toEqual([