diff options
Diffstat (limited to 'tests/slots.rs')
| -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] |
