m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-13 21:03:49 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-13 21:03:49 -0400
commitac62f2f52e0a656d60d2700937fdadabb221fcb3 (patch)
tree2e49f55e19d665b9169402532dbe956f085d55c3 /__tests__
parent2571bdc80a25b0137194bab58029765abe8870b2 (diff)
Rename lexeme
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/lexer.test.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index e887e09..6434e17 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -26,17 +26,17 @@ describe('lex', () => {
describe('lexes basic dice', () => {
it('1d6', () => {
expect(lex('1d6')).toEqual([
- { type: 'number', value: 1 },
+ { type: 'constant', value: 1 },
{ type: 'd' },
- { type: 'number', value: 6 }
+ { type: 'constant', value: 6 }
])
})
it('42d172', () => {
expect(lex('42d172')).toEqual([
- { type: 'number', value: 42 },
+ { type: 'constant', value: 42 },
{ type: 'd' },
- { type: 'number', value: 172 }
+ { type: 'constant', value: 172 }
])
})
})
@@ -44,23 +44,23 @@ describe('lex', () => {
describe('lexes addition', () => {
it('1d6 + 1d4', () => {
expect(lex('1d6 + 1d4')).toEqual([
- { type: 'number', value: 1 },
+ { type: 'constant', value: 1 },
{ type: 'd' },
- { type: 'number', value: 6 },
+ { type: 'constant', value: 6 },
{ type: '+' },
- { type: 'number', value: 1 },
+ { type: 'constant', value: 1 },
{ type: 'd' },
- { type: 'number', value: 4 }
+ { type: 'constant', value: 4 }
])
})
it('2d17 + 4', () => {
expect(lex('2d17 + 4')).toEqual([
- { type: 'number', value: 2 },
+ { type: 'constant', value: 2 },
{ type: 'd' },
- { type: 'number', value: 17 },
+ { type: 'constant', value: 17 },
{ type: '+' },
- { type: 'number', value: 4 }
+ { type: 'constant', value: 4 }
])
})
})