diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-29 23:06:22 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-29 23:06:22 +0100 |
| commit | 810e212b4b255914cfa73e85b52ec23db281c0e3 (patch) | |
| tree | 01e8035ce2945112af5ef41ef8959890bb0ef722 /tests/client_ui.rs | |
| parent | v3.0.0: cursor-driven roulette felt with splits and corners; drop schema migr... (diff) | |
| download | zagan-bet-810e212b4b255914cfa73e85b52ec23db281c0e3.tar.gz zagan-bet-810e212b4b255914cfa73e85b52ec23db281c0e3.zip | |
v3.1.0: warn on shrink, but let a live round finish
Diffstat (limited to '')
| -rw-r--r-- | tests/client_ui.rs | 12 |
1 files changed, 11 insertions, 1 deletions
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; | |||
| 2 | use zagan_bet::client::ui::{ | 2 | use zagan_bet::client::ui::{ |
| 3 | command_names, completion_lines, display_width, first_contact_lines, format_pong, help_lines, | 3 | command_names, completion_lines, display_width, first_contact_lines, format_pong, help_lines, |
| 4 | host_lines, input_cursor_column, lines_to_move_up, parse_bet_arg, record_history, | 4 | host_lines, input_cursor_column, lines_to_move_up, parse_bet_arg, record_history, |
| 5 | terminal_too_small, visual_line_count, MIN_COLUMNS, MIN_ROWS, | 5 | terminal_size_warning, terminal_too_small, visual_line_count, MIN_COLUMNS, MIN_ROWS, |
| 6 | }; | 6 | }; |
| 7 | 7 | ||
| 8 | #[test] | 8 | #[test] |
| @@ -305,3 +305,13 @@ fn the_roulette_felt_fits_the_minimum_terminal() { | |||
| 305 | "the board must leave room for the prompt and a few transcript lines" | 305 | "the board must leave room for the prompt and a few transcript lines" |
| 306 | ); | 306 | ); |
| 307 | } | 307 | } |
| 308 | |||
| 309 | #[test] | ||
| 310 | fn a_shrunk_terminal_gets_a_one_line_warning() { | ||
| 311 | assert!(terminal_size_warning(80, 24).is_none()); | ||
| 312 | let warning = terminal_size_warning(60, 20).unwrap(); | ||
| 313 | assert!(warning.starts_with("WARNING:")); | ||
| 314 | assert!(warning.contains("60x20")); | ||
| 315 | assert!(warning.contains("80x24")); | ||
| 316 | assert!(!warning.contains('\n'), "the board warning must be one line"); | ||
| 317 | } | ||
