diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/client_core.rs | 4 | ||||
| -rw-r--r-- | tests/slots.rs | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/client_core.rs b/tests/client_core.rs index 91ddcab..ea99d52 100644 --- a/tests/client_core.rs +++ b/tests/client_core.rs | |||
| @@ -134,7 +134,9 @@ fn play_shows_a_nine_line_board_and_fetches_the_balance() { | |||
| 134 | 134 | ||
| 135 | assert_eq!(h.board().len(), 9); | 135 | assert_eq!(h.board().len(), 9); |
| 136 | assert!(h.board()[1].contains("Bet: 50 PLN")); | 136 | assert!(h.board()[1].contains("Bet: 50 PLN")); |
| 137 | assert!(h.board()[1].contains("Lines: 5")); | 137 | assert!(!h.board()[1].contains("Lines:")); |
| 138 | assert!(h.board()[5].contains("Pays 3/4/5 x bet:")); | ||
| 139 | assert!(h.board()[5].contains("S 9/30/150")); | ||
| 138 | assert!(h.sent.contains(&"INFO".to_string())); | 140 | assert!(h.sent.contains(&"INFO".to_string())); |
| 139 | 141 | ||
| 140 | h.reply("INFO alice 1 1000"); | 142 | h.reply("INFO alice 1 1000"); |
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 | ||
