Skip to content

Commit

Permalink
Merge pull request #218 from charleskawczynski/ck/update_fuzz_utils
Browse files Browse the repository at this point in the history
Update fuzz_utils
  • Loading branch information
charleskawczynski authored Aug 27, 2023
2 parents 01cf284 + bfec947 commit 9cc4449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions test/fuzz_play.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ fuzz_debug(;fun=tournament!,n_players=10,bank_roll=30,n_games=3788)
where `3788` was found from
fuzz(;fun=tournament!,n_players=10,bank_roll=30,n_games=10000)
players = (
Player(Bot5050(), 1; bank_roll=9),
Player(Bot5050(), 2; bank_roll=5),
Player(Bot5050(), 3; bank_roll=4),
)
fuzz_given_players_debug(;fun=play!, players, n_games=138)
fuzz_debug(; fun = tournament!, n_players = 2, bank_roll = 6, n_games = 1)
fuzz_debug(; fun = tournament!, n_players = 3, bank_roll = 6, n_games = 38)
fuzz_debug(; fun = play!, n_players = 3, bank_roll = 200, n_games = 2373)
Expand Down
10 changes: 7 additions & 3 deletions test/fuzz_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ swap the logger to debug level for the
indices that fail.
=#
function fuzz_debug(;fun,n_players, n_games, bank_roll=200)
crashes = fuzz(;fun=fun,n_players=n_players, n_games=n_games, bank_roll=bank_roll)
Random.seed!(1234)
players = ntuple(i->Player(Bot5050(), i; bank_roll=bank_roll), n_players)
fuzz_given_players_debug(;fun,n_games, players)
end

function fuzz_given_players_debug(;fun,n_games, players)
crashes = fuzz_given_players(;fun=fun,players=deepcopy(players), n_games=n_games)
Random.seed!(1234)
@time begin
games = get_games(; n_games=n_games, crashes=crashes, players=players)
games = get_games(; n_games=n_games, crashes=crashes, players=deepcopy(players))
end
for n in 1:length(games)
try
Expand Down

0 comments on commit 9cc4449

Please sign in to comment.