Closed imnotjames closed 6 years ago
in the example 2d20-d5+4 the outhput was incorrect because4 the output was 10 because it the plugin parsed it as "2D20" + "1D5" + "4"parsed it as "2D20" + "1D5" + "4"
instead, it needs to be parsed as "2D20" + "-1D5" + "4"
Can you add a unit test here? Follow the format used in bf.py
Sure, I took a crack at doing this without bringing in a separate mocking library to patch random.randint like I did in the other tests for this.
random.randint
in the example 2d20-d5+4 the outhput was incorrect because4 the output was 10 because it the plugin parsed it as "2D20" + "1D5" + "4"parsed it as "2D20" + "1D5" + "4"
instead, it needs to be parsed as "2D20" + "-1D5" + "4"