New function to combine dice, and use this function for hit dice.

Fixes: https://github.com/canismarko/dungeon-sheets/issues/84
This commit is contained in:
Mark Wolfman
2021-08-08 13:23:15 -05:00
parent 339dd61bce
commit 700541a35d
3 changed files with 42 additions and 2 deletions
+5
View File
@@ -19,6 +19,11 @@ class TestDice(TestCase):
with self.assertRaises(DiceError):
dice.read_dice_str("Ed15")
def test_combine_dice(self):
self.assertEqual(dice.combine_dice("1d8 + 6 + 2d8 + 12"), "3d8 + 18")
self.assertEqual(dice.combine_dice("1d8 + 1d5 + 2d8 + 1d5"), "2d5 + 3d8")
def test_simple_rolling(self):
num_tests = 100
for _ in range(num_tests):