m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__/lexer.test.js
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-09-05 22:43:38 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-09-05 22:43:38 -0400
commite7383cc38bf2182e5ab95f30d639fe4a0317fd51 (patch)
tree5d2ebb3304dc5e7ba16e360c7940e4af4e49b272 /__tests__/lexer.test.js
parent83983efa99d910a97a72fc8b00dd9d7eb8829368 (diff)
Implement bonus division
Diffstat (limited to '__tests__/lexer.test.js')
-rw-r--r--__tests__/lexer.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index 31150bc..7124746 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -253,6 +253,18 @@ describe('lex', () => {
})
})
+ describe('bonusDivide', () => {
+ test('3d4/1', () => {
+ expect(lex('3d4/1')).toEqual([
+ { type: 'constant', value: 3 },
+ { type: 'd' },
+ { type: 'constant', value: 4 },
+ { type: 'divide' },
+ { type: 'constant', value: 1 }
+ ])
+ })
+ })
+
describe('again', () => {
test('6A3d6', () => {
expect(lex('6A3d6')).toEqual([