From 7d18a268547734daf19a740b6533e9c1697baf1a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:31:54 +0100 Subject: v1.2.1: track wrapped board lines and split the paytable --- tests/client_core.rs | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'tests/client_core.rs') diff --git a/tests/client_core.rs b/tests/client_core.rs index ea99d52..e75a611 100644 --- a/tests/client_core.rs +++ b/tests/client_core.rs @@ -128,19 +128,19 @@ impl Harness { } #[test] -fn play_shows_a_nine_line_board_and_fetches_the_balance() { +fn play_shows_a_ten_line_board_and_fetches_the_balance() { let mut h = Harness::new(); h.line("play slots 50"); - assert_eq!(h.board().len(), 9); + assert_eq!(h.board().len(), 10); assert!(h.board()[1].contains("Bet: 50 PLN")); 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.board()[6].contains("G 4/12/40 D 6/18/70 S 9/30/150")); assert!(h.sent.contains(&"INFO".to_string())); h.reply("INFO alice 1 1000"); - assert_eq!(h.board().len(), 9); + assert_eq!(h.board().len(), 10); assert!(h.board()[1].contains("Balance: 1000 PLN")); } @@ -151,22 +151,22 @@ fn spin_replaces_the_board_and_keeps_the_controls_line() { let lines_before_spin = h.screen.lines.len(); h.key(Key::Char(' ')); - assert_eq!(h.board().len(), 9); - assert!(h.board()[6].contains("Spinning...")); - assert!(h.board()[8].contains("[Q] Quit")); + assert_eq!(h.board().len(), 10); + assert!(h.board()[7].contains("Spinning...")); + assert!(h.board()[9].contains("[Q] Quit")); assert!(h.sent.iter().any(|line| line == "PLAY_START slots 50")); assert_eq!(h.screen.lines.len(), lines_before_spin); h.reply("GAME_RESULT session-1 100 50 1050 CCCCLLCLODGSDGS win 1 0,3,6"); - assert_eq!(h.board().len(), 9); + assert_eq!(h.board().len(), 10); assert!(h .board() .get(2) .is_some_and(|line| line.contains("{ C } { C } { C } [ D ] [ D ]"))); - assert!(h.board()[6].contains("Won 100 PLN")); - assert!(h.board()[7].contains("Winning lines: 1")); + assert!(h.board()[7].contains("Won 100 PLN")); + assert!(h.board()[8].contains("Winning lines: 1")); assert!(h.board()[1].contains("Balance: 1050 PLN")); - assert!(h.board()[8].contains("[Q] Quit")); + assert!(h.board()[9].contains("[Q] Quit")); assert_eq!(h.screen.lines.len(), lines_before_spin); } @@ -180,7 +180,7 @@ fn changing_the_bet_after_a_spin_does_not_leave_stale_lines() { h.key(Key::Char('+')); - assert_eq!(h.board().len(), 9); + assert_eq!(h.board().len(), 10); assert!(h.board()[1].contains("Bet: 60 PLN")); assert!(h .board() @@ -205,9 +205,9 @@ fn a_losing_spin_shows_no_win_and_no_winning_lines() { h.reply(&format!("GAME_RESULT session-1 0 10 990 {LOSS} none -")); - assert_eq!(h.board().len(), 9); - assert!(h.board()[6].contains("No win.")); - assert_eq!(h.board()[7], ""); + assert_eq!(h.board().len(), 10); + assert!(h.board()[7].contains("No win.")); + assert_eq!(h.board()[8], ""); assert!(!h.board()[2].contains('{')); } @@ -219,9 +219,9 @@ fn a_mega_win_shows_all_winning_lines() { h.reply(&format!("GAME_RESULT session-1 750 10 1740 {ALL_C} mega 1,2,3,4,5 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14")); - assert_eq!(h.board().len(), 9); - assert!(h.board()[6].contains("MEGA WIN! 750 PLN")); - assert!(h.board()[7].contains("Winning lines: 1,2,3,4,5")); + assert_eq!(h.board().len(), 10); + assert!(h.board()[7].contains("MEGA WIN! 750 PLN")); + assert!(h.board()[8].contains("Winning lines: 1,2,3,4,5")); assert_eq!(h.board()[2].matches("{ C }").count(), 5); } @@ -245,8 +245,8 @@ fn a_server_error_replaces_the_status_line() { h.reply("ERROR Insufficient balance"); - assert_eq!(h.board().len(), 9); - assert!(h.board()[6].contains("ERROR: Insufficient balance")); + assert_eq!(h.board().len(), 10); + assert!(h.board()[7].contains("ERROR: Insufficient balance")); assert!(h.board()[2].contains("[ ? ]")); assert!(!h.board().iter().any(|line| line.contains("Spinning"))); } @@ -259,8 +259,8 @@ fn an_empty_reply_is_an_error_not_a_silent_spin() { h.reply(""); - assert_eq!(h.board().len(), 9); - assert!(h.board()[6].contains("No response from server")); + assert_eq!(h.board().len(), 10); + assert!(h.board()[7].contains("No response from server")); } #[test] @@ -344,7 +344,7 @@ fn play_without_a_bet_uses_the_default() { let mut h = Harness::new(); h.line("play slots"); - assert_eq!(h.board().len(), 9); + assert_eq!(h.board().len(), 10); assert!(h.board()[1].contains("Bet: 10 PLN")); } -- cgit v1.2.3