m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/lexer.test.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index 12835df..6900764 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -125,6 +125,19 @@ describe('lex', () => {
})
})
+ describe('lexes negatives', () => {
+ it('-(1d6)', () => {
+ expect(lex('-(1d6)')).toEqual([
+ { type: 'minus' },
+ { type: '(' },
+ { type: 'constant', value: 1 },
+ { type: 'd' },
+ { type: 'constant', value: 6 },
+ { type: ')' }
+ ])
+ })
+ })
+
describe('exploding dice', () => {
test('1E1d6', () => {
expect(lex('1E1d6')).toEqual([