From 33452f55afcad603f72e054d56ad7848a3d09503 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:24:08 +0100 Subject: v1.2.0: show the symbol paytable on the slots board --- tests/client_core.rs | 4 +++- tests/slots.rs | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'tests') 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() { assert_eq!(h.board().len(), 9); assert!(h.board()[1].contains("Bet: 50 PLN")); - assert!(h.board()[1].contains("Lines: 5")); + assert!(!h.board()[1].contains("Lines:")); + assert!(h.board()[5].contains("Pays 3/4/5 x bet:")); + assert!(h.board()[5].contains("S 9/30/150")); assert!(h.sent.contains(&"INFO".to_string())); 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 @@ //! Regression tests for the server-side 5x3 slots game. +use zagan_bet::slots::{paytable_line, PAYTABLE}; use zagan_bet::server::games::slots::{LineWin, SlotsGame, PAYLINES, REELS, ROWS}; use zagan_bet::server::games::traits::{Game, GamePhase}; @@ -106,6 +107,19 @@ fn theoretical_rtp_is_just_under_one() { assert!(rtp > 0.98, "house edge should be tiny"); } +#[test] +fn the_paytable_line_lists_every_symbol_and_fits_80_columns() { + let line = paytable_line(); + + for (symbol, three, four, five) in PAYTABLE { + assert!( + line.contains(&format!("{symbol} {three}/{four}/{five}")), + "paytable is missing {symbol}" + ); + } + assert!(line.len() <= 80, "paytable is too wide: {line:?}"); +} + #[test] fn an_enormous_bet_saturates_instead_of_overflowing() { let (winnings, _) = payout(["SSSSS", "SSSSS", "SSSSS"], u64::MAX); -- cgit v1.2.3