m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/lexer.test.js14
-rw-r--r--__tests__/parser.test.js4
2 files changed, 9 insertions, 9 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index 04a95e1..76cb421 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -55,7 +55,7 @@ describe('lex', () => {
{ type: 'constant', value: 1 },
{ type: 'd' },
{ type: 'constant', value: 6 },
- { type: '+' },
+ { type: 'bigPlus' },
{ type: 'constant', value: 1 },
{ type: 'd' },
{ type: 'constant', value: 4 }
@@ -67,7 +67,7 @@ describe('lex', () => {
{ type: 'constant', value: 2 },
{ type: 'd' },
{ type: 'constant', value: 17 },
- { type: '+' },
+ { type: 'bigPlus' },
{ type: 'constant', value: 4 }
])
})
@@ -79,7 +79,7 @@ describe('lex', () => {
{ type: 'constant', value: 1 },
{ type: 'd' },
{ type: 'constant', value: 6 },
- { type: '-' },
+ { type: 'bigMinus' },
{ type: 'constant', value: 1 },
{ type: 'd' },
{ type: 'constant', value: 4 }
@@ -91,7 +91,7 @@ describe('lex', () => {
{ type: 'constant', value: 2 },
{ type: 'd' },
{ type: 'constant', value: 17 },
- { type: '-' },
+ { type: 'bigMinus' },
{ type: 'constant', value: 4 }
])
})
@@ -110,13 +110,13 @@ describe('lex', () => {
])
})
- it('2d(6+3)d4', () => {
- expect(lex('2d(6+3)d4')).toEqual([
+ it('2d(6 + 3)d4', () => {
+ expect(lex('2d(6 + 3)d4')).toEqual([
{ type: 'constant', value: 2 },
{ type: 'd' },
{ type: '(' },
{ type: 'constant', value: 6 },
- { type: '+' },
+ { type: 'bigPlus' },
{ type: 'constant', value: 3 },
{ type: ')' },
{ type: 'd' },
diff --git a/__tests__/parser.test.js b/__tests__/parser.test.js
index fb554f9..bc88894 100644
--- a/__tests__/parser.test.js
+++ b/__tests__/parser.test.js
@@ -152,8 +152,8 @@ describe('parse', () => {
})
})
- test('2d(6+3)d4', () => {
- expect(parse('2d(6+3)d4')).toEqual({
+ test('2d(6 + 3)d4', () => {
+ expect(parse('2d(6 + 3)d4')).toEqual({
type: 'd',
left: { type: 'constant', value: 2 },
right: {