m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__/parser.test.js
diff options
context:
space:
mode:
Diffstat (limited to '__tests__/parser.test.js')
-rw-r--r--__tests__/parser.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/__tests__/parser.test.js b/__tests__/parser.test.js
index 5580b4c..3c9f6ec 100644
--- a/__tests__/parser.test.js
+++ b/__tests__/parser.test.js
@@ -165,6 +165,18 @@ describe('parse', () => {
})
})
+ it('parses divisional bonuses', () => {
+ expect(parse('3d4/1')).toEqual({
+ type: 'bonusDivide',
+ left: {
+ type: 'd',
+ left: { type: 'constant', value: 3 },
+ right: { type: 'constant', value: 4 }
+ },
+ right: { type: 'constant', value: 1 }
+ })
+ })
+
test('bonus binds stronger than addition', () => {
expect(parse('2d6 + 2d6+2d6')).toEqual({
type: 'add',