summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 23:24:08 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 23:24:08 +0100
commit33452f55afcad603f72e054d56ad7848a3d09503 (patch)
treefcef1b0e4a88284ff3fc652fbaecdb087413a17f /tests
parentv1.1.0: highlight winning symbols on the slots board (diff)
downloadzagan-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/client_core.rs4
-rw-r--r--tests/slots.rs14
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
3use zagan_bet::slots::{paytable_line, PAYTABLE};
3use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; 4use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS};
4use zagan_bet::server::games::traits::{Game, GamePhase}; 5use 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]
111fn 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]
110fn an_enormous_bet_saturates_instead_of_overflowing() { 124fn 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