summaryrefslogtreecommitdiffstats
path: root/tests/client_ui.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/client_ui.rs12
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;
2use zagan_bet::client::ui::{ 2use 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]
310fn 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}