From 810e212b4b255914cfa73e85b52ec23db281c0e3 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 23:06:22 +0100 Subject: v3.1.0: warn on shrink, but let a live round finish --- tests/client_ui.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/client_ui.rs') diff --git a/tests/client_ui.rs b/tests/client_ui.rs index 7969139..6e00903 100644 --- a/tests/client_ui.rs +++ b/tests/client_ui.rs @@ -2,7 +2,7 @@ use std::time::Duration; use zagan_bet::client::ui::{ command_names, completion_lines, display_width, first_contact_lines, format_pong, help_lines, host_lines, input_cursor_column, lines_to_move_up, parse_bet_arg, record_history, - terminal_too_small, visual_line_count, MIN_COLUMNS, MIN_ROWS, + terminal_size_warning, terminal_too_small, visual_line_count, MIN_COLUMNS, MIN_ROWS, }; #[test] @@ -305,3 +305,13 @@ fn the_roulette_felt_fits_the_minimum_terminal() { "the board must leave room for the prompt and a few transcript lines" ); } + +#[test] +fn a_shrunk_terminal_gets_a_one_line_warning() { + assert!(terminal_size_warning(80, 24).is_none()); + let warning = terminal_size_warning(60, 20).unwrap(); + assert!(warning.starts_with("WARNING:")); + assert!(warning.contains("60x20")); + assert!(warning.contains("80x24")); + assert!(!warning.contains('\n'), "the board warning must be one line"); +} -- cgit v1.2.3