Skip to content

Commit

Permalink
add test_map_and_time_extra_args
Browse files Browse the repository at this point in the history
  • Loading branch information
HighDiceRoller committed Sep 15, 2024
1 parent 5c7b91b commit bb757b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,10 @@ def test_fractional_coin():
def test_stochastic_round():
assert ((6 @ d6) / 2).stochastic_round().mean() == 10.5
assert ((6 @ d6) / Fraction(3)).stochastic_round().mean() == 7


def test_map_and_time_extra_args():
def test_function(current, roll):
return min(current + roll, 10)
result = Die([0]).map_and_time(test_function, d6, repeat=10)
assert result.marginals[1].mean() == d6.mean_time_to_sum(10)

0 comments on commit bb757b7

Please sign in to comment.