From 72c34731ec226147db153c35e41b05de0eb25870 Mon Sep 17 00:00:00 2001 From: Alex Pasmantier Date: Fri, 25 Jul 2025 01:43:29 +0200 Subject: [PATCH] test(pty): longer delay when checking pty exit code --- tests/channels.rs | 4 ++-- tests/cli/cli_config.rs | 6 +++--- tests/cli/cli_input.rs | 10 +++++----- tests/cli/cli_modes.rs | 12 ++++++------ tests/cli/cli_monitoring.rs | 4 ++-- tests/cli/cli_preview.rs | 18 ++++++++--------- tests/cli/cli_source.rs | 6 +++--- tests/cli/cli_special.rs | 4 ++-- tests/cli/cli_ui.rs | 38 ++++++++++++++++++------------------ tests/cli/cli_ui_behavior.rs | 16 +++++++-------- tests/common/mod.rs | 2 +- tests/remote_control.rs | 4 ++-- tests/subcommands.rs | 8 ++++---- 13 files changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/channels.rs b/tests/channels.rs index f931fe2..e480e3c 100644 --- a/tests/channels.rs +++ b/tests/channels.rs @@ -11,7 +11,7 @@ fn tv_ctrl_c() { tester.send(&ctrl('c')); // Check if the child process exited with a timeout - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Test that the various channels open correctly, spawn a UI that contains the @@ -32,7 +32,7 @@ macro_rules! test_channel { )); tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } )* } diff --git a/tests/cli/cli_config.rs b/tests/cli/cli_config.rs index 47decaa..5f6931f 100644 --- a/tests/cli/cli_config.rs +++ b/tests/cli/cli_config.rs @@ -33,7 +33,7 @@ fn test_path_as_positional_argument_sets_working_directory() { // Send Ctrl+C to exit cleanly tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the --config-file flag loads a custom configuration file. @@ -56,7 +56,7 @@ fn test_config_file_flag_loads_custom_config() { // Send Ctrl+C to exit cleanly tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the --config-file flag fails to load a custom configuration file. @@ -100,7 +100,7 @@ fn test_cable_dir_flag_loads_custom_cable_dir() { // Send Ctrl+C to exit cleanly tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the --cable-dir flag fails to load channels from a custom directory. diff --git a/tests/cli/cli_input.rs b/tests/cli/cli_input.rs index 5fd9857..02b880f 100644 --- a/tests/cli/cli_input.rs +++ b/tests/cli/cli_input.rs @@ -27,7 +27,7 @@ fn test_input_prefills_search_box() { // Send Ctrl+C to exit the application gracefully tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that custom keybindings override default keyboard shortcuts. @@ -52,7 +52,7 @@ fn test_keybindings_override_default() { // Test that our custom "a" key now quits the application tester.send("'a'"); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that multiple keybinding overrides can be specified simultaneously. @@ -78,7 +78,7 @@ fn test_multiple_keybindings_override() { // Use "a" to quit remote control mode, then "a" again to quit the application tester.send("'a'"); // Exit remote control tester.send("'a'"); // Exit application - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the --exact flag enables exact substring matching instead of fuzzy matching. @@ -105,7 +105,7 @@ fn test_exact_matching_enabled() { // Send Ctrl+C to exit the application tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } #[test] @@ -133,5 +133,5 @@ fn test_exact_matching_enabled_fails() { // Send Ctrl+C to exit the application tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } diff --git a/tests/cli/cli_modes.rs b/tests/cli/cli_modes.rs index 769de00..8f51e4a 100644 --- a/tests/cli/cli_modes.rs +++ b/tests/cli/cli_modes.rs @@ -23,7 +23,7 @@ fn test_channel_mode_with_channel_name() { // Send Ctrl+C to exit the application tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that Channel Mode works with both channel name and working directory specified. @@ -46,7 +46,7 @@ fn test_channel_mode_with_channel_and_path() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that CLI flags can override channel defaults in Channel Mode. @@ -64,7 +64,7 @@ fn test_channel_mode_with_channel_and_overrides() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that basic Ad-hoc Mode activation works with --source-command. @@ -81,7 +81,7 @@ fn test_adhoc_mode_with_source_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that Ad-hoc Mode requires --source-command for dependent flags. @@ -115,7 +115,7 @@ fn test_smart_path_detection_switches_to_adhoc_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that fallback to default channel works when no arguments are provided. @@ -132,5 +132,5 @@ fn test_no_arguments_uses_default_channel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } diff --git a/tests/cli/cli_monitoring.rs b/tests/cli/cli_monitoring.rs index 056245b..741590a 100644 --- a/tests/cli/cli_monitoring.rs +++ b/tests/cli/cli_monitoring.rs @@ -41,7 +41,7 @@ fn test_watch_reloads_source_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --tick-rate accepts a valid positive number. @@ -59,7 +59,7 @@ fn test_tick_rate_valid_value_starts_application() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --tick-rate rejects non-positive numbers. diff --git a/tests/cli/cli_preview.rs b/tests/cli/cli_preview.rs index c5d776c..94ad974 100644 --- a/tests/cli/cli_preview.rs +++ b/tests/cli/cli_preview.rs @@ -28,7 +28,7 @@ fn test_preview_command_in_adhoc_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --preview-command can override channel defaults in Channel Mode. @@ -52,7 +52,7 @@ fn test_preview_command_override_in_channel_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --preview-header displays custom text above the preview panel. @@ -73,7 +73,7 @@ fn test_preview_header_with_preview_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --preview-footer displays custom text below the preview panel. @@ -94,7 +94,7 @@ fn test_preview_footer_with_preview_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --preview-offset controls the scroll position in preview content. @@ -119,7 +119,7 @@ fn test_preview_offset_with_preview_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --preview-size controls the width of the preview panel. @@ -142,7 +142,7 @@ fn test_preview_size_with_preview_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --no-preview completely disables the preview panel. @@ -163,7 +163,7 @@ fn test_no_preview_disables_preview_panel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --no-preview conflicts with --preview-command. @@ -297,7 +297,7 @@ fn test_hide_preview_flag_starts_with_preview_hidden() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --show-preview starts the interface with the preview panel visible. @@ -315,7 +315,7 @@ fn test_show_preview_flag_starts_with_preview_visible() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-preview and --show-preview cannot be used together. diff --git a/tests/cli/cli_source.rs b/tests/cli/cli_source.rs index 52c1ef5..bba35e8 100644 --- a/tests/cli/cli_source.rs +++ b/tests/cli/cli_source.rs @@ -20,7 +20,7 @@ fn test_source_command_in_adhoc_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --source-command can override channel defaults in Channel Mode. @@ -41,7 +41,7 @@ fn test_source_command_override_in_channel_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --source-display formats how entries appear in the results list. @@ -64,7 +64,7 @@ fn test_source_display_with_source_command() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --source-output formats the final output when an entry is selected. diff --git a/tests/cli/cli_special.rs b/tests/cli/cli_special.rs index 9ff5fac..d8f05c9 100644 --- a/tests/cli/cli_special.rs +++ b/tests/cli/cli_special.rs @@ -28,7 +28,7 @@ fn test_autocomplete_prompt_activates_channel_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --autocomplete-prompt conflicts with explicit channel argument. @@ -63,7 +63,7 @@ fn test_autocomplete_prompt_with_working_directory() { // Send Ctrl+C to exit (the test is mainly to ensure no CLI parsing error) tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the `list-channels` subcommand lists available channels. diff --git a/tests/cli/cli_ui.rs b/tests/cli/cli_ui.rs index 58a43a1..95b75c3 100644 --- a/tests/cli/cli_ui.rs +++ b/tests/cli/cli_ui.rs @@ -27,7 +27,7 @@ fn test_layout_landscape() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --layout portrait arranges panels vertically stacked. @@ -47,7 +47,7 @@ fn test_layout_portrait() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --input-header customizes the text above the search input in Channel Mode. @@ -66,7 +66,7 @@ fn test_input_header_in_channel_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --input-header works in Ad-hoc Mode. @@ -86,7 +86,7 @@ fn test_input_header_in_adhoc_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --input-prompt customizes the prompt symbol in Channel Mode. @@ -105,7 +105,7 @@ fn test_input_prompt_in_channel_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --input-prompt works in Ad-hoc Mode. @@ -125,7 +125,7 @@ fn test_input_prompt_in_adhoc_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the default input prompt "> " is used when no custom prompt is specified. @@ -143,7 +143,7 @@ fn test_default_input_prompt() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --ui-scale adjusts the overall interface size. @@ -163,7 +163,7 @@ fn test_ui_scale() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --no-remote hides the remote control panel. @@ -180,7 +180,7 @@ fn test_no_remote_hides_remote_panel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --no-status-bar hides the bottom status bar. @@ -198,7 +198,7 @@ fn test_no_status_bar_hides_status_bar() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-status-bar starts the interface with the status bar hidden. @@ -216,7 +216,7 @@ fn test_hide_status_bar_flag_hides_status_bar() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --show-status-bar ensures the status bar is visible. @@ -234,7 +234,7 @@ fn test_show_status_bar_flag_shows_status_bar() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-status-bar conflicts with --no-status-bar. @@ -288,7 +288,7 @@ fn test_show_remote_flag_shows_remote_panel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-remote prevents the remote control panel from showing at startup. @@ -305,7 +305,7 @@ fn test_hide_remote_flag_hides_remote_panel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-remote conflicts with --no-remote. @@ -360,7 +360,7 @@ fn test_no_help_panel_disables_help_panel() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-help-panel starts the interface with the help panel hidden. @@ -381,7 +381,7 @@ fn test_hide_help_panel_starts_with_help_hidden() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --show-help-panel ensures the help panel is visible. @@ -399,7 +399,7 @@ fn test_show_help_panel_starts_with_help_visible() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that --hide-help-panel conflicts with --no-help-panel. @@ -486,7 +486,7 @@ fn test_tui_with_height_and_width() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); unsafe { std::env::remove_var(TESTING_ENV_VAR) }; } @@ -519,6 +519,6 @@ fn test_tui_with_height_only() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); unsafe { std::env::remove_var(TESTING_ENV_VAR) }; } diff --git a/tests/cli/cli_ui_behavior.rs b/tests/cli/cli_ui_behavior.rs index 2e7a751..059bfc9 100644 --- a/tests/cli/cli_ui_behavior.rs +++ b/tests/cli/cli_ui_behavior.rs @@ -27,7 +27,7 @@ fn test_toggle_preview_keybinding() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the toggle remote control keybinding functionality works correctly. @@ -50,7 +50,7 @@ fn test_toggle_remote_control_keybinding() { // Send Ctrl+C again to exit the application tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the toggle status bar keybinding functionality works correctly. @@ -74,7 +74,7 @@ fn test_toggle_status_bar_keybinding() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the toggle help keybinding functionality works correctly. @@ -94,7 +94,7 @@ fn test_toggle_help_keybinding() { // Send Ctrl+C to exit (help panel should close and app should exit) tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the preview scrolling keybindings functionality works correctly. @@ -126,7 +126,7 @@ fn test_scroll_preview_keybindings() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the reload source keybinding functionality works correctly. @@ -162,7 +162,7 @@ fn test_reload_source_keybinding() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that the cycle sources keybinding functionality works correctly. @@ -183,7 +183,7 @@ fn test_cycle_sources_keybinding() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests that preview toggle is disabled when in remote control mode. @@ -236,5 +236,5 @@ fn test_toggle_preview_disabled_in_remote_control_mode() { // Send Ctrl+C to exit tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index a28b9e7..f2d8df5 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -53,7 +53,7 @@ pub const DEFAULT_DELAY: Duration = Duration::from_millis(100); /// tester.send(&ctrl('c')); /// /// // Assert that the child process exits successfully -/// PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); +/// PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); /// } /// ``` pub struct PtyTester { diff --git a/tests/remote_control.rs b/tests/remote_control.rs index 3f0dcd1..5216f46 100644 --- a/tests/remote_control.rs +++ b/tests/remote_control.rs @@ -18,7 +18,7 @@ fn tv_remote_control_shows() { tester.send(&ctrl('c')); tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } #[test] @@ -38,5 +38,5 @@ fn tv_remote_control_zaps() { tester.send(&ctrl('c')); tester.send(&ctrl('c')); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } diff --git a/tests/subcommands.rs b/tests/subcommands.rs index 53b8662..91d4f9e 100644 --- a/tests/subcommands.rs +++ b/tests/subcommands.rs @@ -9,7 +9,7 @@ fn tv_version() { let mut child = tester.spawn_command(tv_with_args(&["--version"])); tester.assert_raw_output_contains("television"); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Really just a sanity check @@ -19,7 +19,7 @@ fn tv_help() { let mut child = tester.spawn_command(tv_with_args(&["--help"])); tester.assert_raw_output_contains("Cross-platform"); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } /// Tests the `tv list-channels` command. @@ -63,7 +63,7 @@ fn tv_list_channels() { ); } - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); } #[test] @@ -73,5 +73,5 @@ fn tv_init_zsh() { let mut child = tester .spawn_command(tv_local_config_and_cable_with_args(&["init", "zsh"])); - PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY); + PtyTester::assert_exit_ok(&mut child, DEFAULT_DELAY * 2); }