mirror of
https://github.com/alexpasmantier/television.git
synced 2025-07-28 22:01:39 +00:00
test(pty): longer delay when checking pty exit code
This commit is contained in:
parent
a019f18229
commit
72c34731ec
@ -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);
|
||||
}
|
||||
)*
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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) };
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user