m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
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([