diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 23:24:08 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 23:24:08 +0100 |
| commit | 33452f55afcad603f72e054d56ad7848a3d09503 (patch) | |
| tree | fcef1b0e4a88284ff3fc652fbaecdb087413a17f /tests/slots.rs | |
| parent | v1.1.0: highlight winning symbols on the slots board (diff) | |
| download | zagan-bet-33452f55afcad603f72e054d56ad7848a3d09503.tar.gz zagan-bet-33452f55afcad603f72e054d56ad7848a3d09503.zip | |
v1.2.0: show the symbol paytable on the slots board
Diffstat (limited to '')
| -rw-r--r-- | tests/slots.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/slots.rs b/tests/slots.rs index 857e607..b7292b8 100644 --- a/tests/slots.rs +++ b/tests/slots.rs | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | //! Regression tests for the server-side 5x3 slots game. | 1 | //! Regression tests for the server-side 5x3 slots game. |
| 2 | 2 | ||
| 3 | use zagan_bet::slots::{paytable_line, PAYTABLE}; | ||
| 3 | use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; | 4 | use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; |
| 4 | use zagan_bet::server::games::traits::{Game, GamePhase}; | 5 | use zagan_bet::server::games::traits::{Game, GamePhase}; |
| 5 | 6 | ||
| @@ -107,6 +108,19 @@ fn theoretical_rtp_is_just_under_one() { | |||
| 107 | } | 108 | } |
| 108 | 109 | ||
| 109 | #[test] | 110 | #[test] |
| 111 | fn the_paytable_line_lists_every_symbol_and_fits_80_columns() { | ||
| 112 | let line = paytable_line(); | ||
| 113 | |||
| 114 | for (symbol, three, four, five) in PAYTABLE { | ||
| 115 | assert!( | ||
| 116 | line.contains(&format!("{symbol} {three}/{four}/{five}")), | ||
| 117 | "paytable is missing {symbol}" | ||
| 118 | ); | ||
| 119 | } | ||
| 120 | assert!(line.len() <= 80, "paytable is too wide: {line:?}"); | ||
| 121 | } | ||
| 122 | |||
| 123 | #[test] | ||
| 110 | fn an_enormous_bet_saturates_instead_of_overflowing() { | 124 | fn an_enormous_bet_saturates_instead_of_overflowing() { |
| 111 | let (winnings, _) = payout(["SSSSS", "SSSSS", "SSSSS"], u64::MAX); | 125 | let (winnings, _) = payout(["SSSSS", "SSSSS", "SSSSS"], u64::MAX); |
| 112 | 126 | ||
