diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 23:31:54 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 23:31:54 +0100 |
| commit | 7d18a268547734daf19a740b6533e9c1697baf1a (patch) | |
| tree | 789f519a19b053b8ad0ff41d2828fe22c06fb21a /tests/slots.rs | |
| parent | v1.2.0: show the symbol paytable on the slots board (diff) | |
| download | zagan-bet-7d18a268547734daf19a740b6533e9c1697baf1a.tar.gz zagan-bet-7d18a268547734daf19a740b6533e9c1697baf1a.zip | |
v1.2.1: track wrapped board lines and split the paytable
Diffstat (limited to '')
| -rw-r--r-- | tests/slots.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/slots.rs b/tests/slots.rs index b7292b8..bdf8f10 100644 --- a/tests/slots.rs +++ b/tests/slots.rs | |||
| @@ -1,6 +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::slots::{paytable_lines, PAYTABLE}; |
| 4 | use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; | 4 | use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; |
| 5 | use zagan_bet::server::games::traits::{Game, GamePhase}; | 5 | use zagan_bet::server::games::traits::{Game, GamePhase}; |
| 6 | 6 | ||
| @@ -108,16 +108,20 @@ fn theoretical_rtp_is_just_under_one() { | |||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | #[test] | 110 | #[test] |
| 111 | fn the_paytable_line_lists_every_symbol_and_fits_80_columns() { | 111 | fn the_paytable_lines_list_every_symbol_and_fit_80_columns() { |
| 112 | let line = paytable_line(); | 112 | let lines = paytable_lines(); |
| 113 | let joined = lines.join(" "); | ||
| 113 | 114 | ||
| 115 | assert_eq!(lines.len(), 2, "paytable should be split into two lines"); | ||
| 114 | for (symbol, three, four, five) in PAYTABLE { | 116 | for (symbol, three, four, five) in PAYTABLE { |
| 115 | assert!( | 117 | assert!( |
| 116 | line.contains(&format!("{symbol} {three}/{four}/{five}")), | 118 | joined.contains(&format!("{symbol} {three}/{four}/{five}")), |
| 117 | "paytable is missing {symbol}" | 119 | "paytable is missing {symbol}" |
| 118 | ); | 120 | ); |
| 119 | } | 121 | } |
| 120 | assert!(line.len() <= 80, "paytable is too wide: {line:?}"); | 122 | for line in lines { |
| 123 | assert!(line.len() <= 80, "paytable is too wide: {line:?}"); | ||
| 124 | } | ||
| 121 | } | 125 | } |
| 122 | 126 | ||
| 123 | #[test] | 127 | #[test] |
