Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test Inventory - Classification and Overview of All Tests

Created Date: 2025-11-06 Last Updated: 2026-08-20 (test counts and test lists only — see coverage note below) Total Number of Tests: 251 (Unit 190 + Integration 61); 26 additional manual E2E cases Coverage: 68.95% (533/773 lines) — carried over from 2025-11-06, not re-measured in this update (cargo-tarpaulin was unavailable in the environment this update was made from); treat per-module coverage figures below as stale


Test Classification

Test Pyramid Structure

Test TypeCountLocation
Unit Tests190src/ within #[cfg(test)]
Integration Tests61tests/ directory
E2E Tests26 casesdocs/tests/ (Manual)
Total251-

1. Unit Tests (190)

1.1 cache/types.rs (6)

Location: src/cache/types.rs within #[cfg(test)] module

Purpose: Data structure serialization/deserialization, type conversion

Test NamePurposeImportance
test_gist_cache_serializationGistCache JSON conversion⭐⭐⭐
test_datetime_serializationDatetime serialization (without sub-seconds)⭐⭐⭐
test_datetime_deserializationDatetime deserialization⭐⭐⭐
test_gist_info_without_descriptionHandling Gist without description⭐⭐
test_github_gist_to_gist_infoGitHub API → Internal type conversion⭐⭐⭐
test_gist_file_cloneGistFile clone⭐

Coverage: 100% (15/15 lines) — stale, see note above

Windows Support: ✅ Fully supported (no file I/O dependencies)


1.2 config.rs (8)

Location: src/config.rs within #[cfg(test)] module

Purpose: Configuration management, platform-specific path generation, interpreter mapping

Test NamePurposeImportance
test_config_newConfig initialization⭐⭐⭐
test_config_defaultDefault settings⭐⭐⭐
test_config_persistenceSave/load round-trip to disk⭐⭐⭐
test_ensure_cache_dirCache directory creation⭐⭐⭐
test_ensure_download_dirDownload directory creation⭐⭐
test_cache_existsCache file existence check⭐⭐
test_legacy_single_interpreter_configBackward-compat single-interpreter config⭐⭐⭐
test_set_nested_interpreter_configExtension-based interpreter mapping (defaults.interpreter.<ext>)⭐⭐⭐

Coverage: 96.15% (25/26 lines) — stale, see note above

Windows Support: ✅ Fully supported (tests platform-specific path generation)


1.3 cache/content.rs (23)

Location: src/cache/content.rs within #[cfg(test)] module

Purpose: Content cache read/write, directory management, cache clean/cache size

Test NamePurposeImportance
test_write_and_readBasic read/write⭐⭐⭐
test_read_nonexistent_fileError handling for non-existent files⭐⭐⭐
test_write_creates_gist_directoryAutomatic directory creation⭐⭐⭐
test_overwrite_existing_fileOverwriting existing file⭐⭐
test_multiple_files_in_same_gistMultiple file management⭐⭐⭐
test_delete_gistDeleting Gist cache⭐⭐
test_delete_gist_already_deletedHandling already deleted Gist⭐
test_list_cached_gistsListing cached Gists⭐⭐
test_list_cached_gists_when_no_cache_dirHandling no cache directory⭐⭐
test_list_cached_gists_with_file_in_contents_dirHandling unexpected files⭐⭐
test_total_sizeCalculating cache size⭐⭐
test_total_size_when_no_cache_dirSize when no directory⭐
test_calculate_dir_sizeDirectory size helper backing cache size⭐⭐
test_clear_allClearing all caches⭐⭐
test_clear_all_when_emptyClearing empty directory⭐
test_cache_path_generationPath generation accuracy⭐⭐
test_self_healing_unexpected_filesSelf-healing of anomalous files⭐⭐
test_clean_with_dry_runcache clean --dry-run preview (no deletion)⭐⭐⭐
test_clean_with_older_thancache clean --older-than criterion⭐⭐⭐
test_clean_with_orphanedcache clean --orphaned criterion⭐⭐⭐
test_clean_with_both_criteriaCombined --older-than + --orphaned⭐⭐
test_clean_with_no_criteriaNo criteria specified (no-op/error)⭐⭐
test_clean_when_nothing_matchesNo entries match the given criteria⭐

Coverage: 83.54% (66/79 lines) — stale, see note above

Windows Support: ✅ Fully supported (cross-platform with tempfile)


1.4 cli.rs (45)

Location: src/cli.rs within #[cfg(test)] module

Purpose: CLI argument parsing, interpreter detection/resolution, shell completions, cache/run subcommands

Test NamePurposeImportance
test_parse_interpreter_bashBash interpreter parsing⭐⭐⭐
test_parse_interpreter_pythonPython interpreter parsing⭐⭐⭐
test_parse_interpreter_python_aliaspython3 alias⭐⭐
test_parse_interpreter_nodeNode interpreter parsing⭐⭐
test_parse_interpreter_rubyRuby interpreter parsing⭐⭐
test_parse_interpreter_phpPHP interpreter parsing⭐⭐
test_parse_interpreter_perlPerl interpreter parsing⭐⭐
test_parse_interpreter_pwshPowerShell Core interpreter parsing⭐⭐
test_parse_interpreter_powershellWindows PowerShell interpreter parsing⭐⭐
test_parse_interpreter_ts_nodets-node interpreter parsing⭐⭐
test_parse_interpreter_denoDeno interpreter parsing⭐⭐
test_parse_interpreter_bunBun interpreter parsing⭐⭐
test_parse_interpreter_uvuv interpreter parsing⭐⭐
test_parse_interpreter_poetryPoetry interpreter parsing⭐⭐
test_parse_interpreter_shsh interpreter parsing⭐⭐
test_parse_interpreter_zshzsh interpreter parsing⭐⭐
test_parse_interpreter_noneNo interpreter specified⭐⭐
test_parse_interpreter_custom_invalidInvalid custom interpreter⭐⭐⭐
test_detect_shebang_env_formatShebang detection, #!/usr/bin/env <x> form⭐⭐⭐
test_detect_shebang_direct_pathShebang detection, direct interpreter path form⭐⭐⭐
test_detect_shebang_no_shebangNo shebang present⭐⭐
test_get_file_extensionExtension extraction from filename⭐⭐
test_language_to_interpretertokei-detected language → interpreter mapping⭐⭐⭐
test_detect_interpreter_from_filenameFilename heuristics (e.g. Makefile)⭐⭐⭐
test_detect_interpreter_from_configUser config (extension-based mapping) takes priority⭐⭐⭐
test_format_bytesByte formatting⭐⭐
test_format_bytes_edge_casesByte boundary values⭐⭐
test_format_bytes_multiple_gbGB unit display⭐
test_generate_completions_bashBash completion script generation⭐⭐⭐
test_generate_completions_zshZsh completion script generation⭐⭐
test_generate_completions_fishFish completion script generation⭐⭐
test_generate_completions_powershellPowerShell completion script generation⭐⭐
test_shell_enum_valuesShell enum variant equality⭐
test_handle_cache_command_list_emptyEmpty cache list⭐⭐
test_handle_cache_command_list_with_cacheCache list display⭐⭐⭐
test_handle_cache_command_list_no_metadataList without metadata⭐⭐
test_handle_cache_command_sizeCache size display⭐⭐
test_handle_cache_command_clean_no_cachecache clean with no cache present⭐⭐
test_handle_cache_command_clean_no_criteriacache clean with no criteria flags⭐⭐
test_handle_cache_command_clean_with_orphanedcache clean --orphaned end-to-end⭐⭐⭐
test_run_gist_cache_not_foundCache not found error⭐⭐⭐
test_run_gist_no_resultsNo search results error⭐⭐⭐
test_run_gist_with_filename_searchFilename search mode⭐⭐⭐
test_run_gist_with_description_searchDescription search mode⭐⭐⭐
test_print_run_helpHelp display⭐

Coverage: 78.16% (161/206 lines) — stale, see note above

Windows Support: ✅ Fully supported


1.5 search/query.rs (23)

Location: src/search/query.rs within #[cfg(test)] module

Purpose: Search functionality, ID/filename/description search

Test NamePurposeImportance
test_search_by_idID search⭐⭐⭐
test_search_id_no_matchID search no match⭐⭐
test_search_by_filenameFilename search⭐⭐⭐
test_search_by_filename_case_insensitiveCase-insensitive filename search⭐⭐⭐
test_search_filename_multiple_filesMultiple file Gist search⭐⭐⭐
test_search_by_descriptionDescription search⭐⭐⭐
test_search_by_description_case_insensitiveCase-insensitive description search⭐⭐⭐
test_search_by_description_no_descriptionGist without description⭐⭐
test_search_bothFilename + description search⭐⭐⭐
test_search_both_filename_only_matchFilename only match⭐⭐
test_search_both_description_only_matchDescription only match⭐⭐
test_search_both_multiple_matchesMultiple matches⭐⭐
test_search_both_no_descriptionBoth search when no description⭐⭐
test_search_mode_auto_detects_idAuto: ID detection⭐⭐⭐
test_search_mode_auto_detects_bothAuto: Keyword detection⭐⭐⭐
test_search_mode_auto_with_short_hexAuto: 31-char hex⭐⭐⭐
test_search_mode_auto_with_non_hexAuto: Non-hexadecimal⭐⭐⭐
test_search_with_auto_mode_idAuto mode: ID⭐⭐
test_search_with_auto_mode_keywordAuto mode: Keyword⭐⭐
test_search_no_resultsNo search results⭐⭐⭐
test_search_empty_gist_listEmpty Gist list⭐⭐
test_select_from_single_resultSelection of single result⭐⭐
test_select_from_empty_resultsSelection from empty results⭐⭐

Coverage: 70.59% (48/68 lines) — stale, see note above

Windows Support: ✅ Fully supported


1.6 search/interactive.rs (36)

Location: src/search/interactive.rs within #[cfg(test)] module

Purpose: Interactive Gist picker — list/preview rendering, scrolling, / search and filter (Closes #74)

Coverage: Not measured (module added after the last coverage run — see note above)

Windows Support: ✅ Fully supported (pure logic, no terminal I/O in these tests)

Item text building

Test NamePurposeImportance
build_item_text_uses_default_when_no_descriptionFallback label when a Gist has no description⭐⭐
build_item_text_omits_filename_already_in_descriptionAvoids duplicating a filename already in the description⭐⭐
build_item_text_appends_filenames_not_in_descriptionAppends filenames missing from the description⭐⭐
build_item_text_appends_only_missing_files_from_multipleOnly appends the subset of filenames not already present⭐⭐

Scroll and viewport management

Test NamePurposeImportance
clamp_scroll_keeps_position_within_boundsScroll offset stays within valid range⭐⭐
clamp_scroll_never_goes_below_range_startScroll offset floor⭐⭐
follow_cursor_keeps_scroll_when_cursor_stays_in_viewNo scroll when cursor is already visible⭐⭐
follow_cursor_scrolls_down_past_bottom_edgeScrolls down when cursor passes the bottom edge⭐⭐
follow_cursor_scrolls_up_past_top_edgeScrolls up when cursor passes the top edge⭐⭐
follow_cursor_never_scrolls_past_the_endScroll clamps at the end of the list⭐⭐
follow_cursor_respects_a_sub_range_startScroll respects a non-zero range start (used by preview)⭐⭐
active_divider_picks_the_last_divider_at_or_before_cursorHeader/divider tracking as the cursor moves through preview⭐⭐
page_capacity_reserves_header_footer_and_marginRow budget accounts for header/footer/margin⭐⭐
visible_window_shows_everything_when_list_fits_budgetNo windowing needed when the list is short⭐⭐
visible_window_includes_selection_and_respects_row_budgetVisible window always contains the current selection⭐⭐⭐
visible_window_does_not_run_past_start_of_listWindow clamps at the start of the list⭐⭐
visible_window_does_not_run_past_end_of_listWindow clamps at the end of the list⭐⭐
visible_window_handles_empty_listEmpty list edge case⭐
visible_window_accounts_for_wrapped_rows_in_full_modeWindow sizing accounts for line-wrapped rows⭐⭐
visual_row_count_wraps_at_widthRow count reflects terminal-width wrapping⭐⭐
visual_row_count_handles_zero_widthZero-width terminal edge case⭐
Test NamePurposeImportance
matcher_supports_regex_patternsRegex matching for / filter⭐⭐⭐
matcher_falls_back_to_literal_on_invalid_regexInvalid regex falls back to literal substring match⭐⭐⭐
matcher_does_plain_case_insensitive_substring_matchingCase-insensitive plain-text matching⭐⭐⭐
matcher_empty_pattern_matches_everythingEmpty pattern matches all items⭐⭐
find_next_match_wraps_forwardPreview search wraps to the top when searching forward⭐⭐
find_next_match_wraps_backwardPreview search wraps to the bottom when searching backward (N)⭐⭐
find_next_match_returns_none_when_nothing_matchesNo match found⭐⭐
find_next_match_ignores_ansi_codes_in_the_lineSearch ignores syntax-highlighting ANSI escape codes⭐⭐⭐

Rendering (list and preview lines)

Test NamePurposeImportance
render_line_shows_everything_when_fullFull-width display mode (Tab toggle)⭐
render_line_truncates_when_not_fullTruncation in short-display mode⭐⭐
render_line_truncates_long_text_even_on_a_wide_terminalTruncation still applies on a wide terminal⭐⭐
render_line_marks_selected_itemSelected row is visually marked⭐⭐
render_preview_line_truncates_to_fit_the_terminal_widthPreview line truncation⭐⭐
render_preview_line_marks_only_the_cursor_rowOnly the cursor row is marked in preview⭐⭐
render_preview_line_keeps_short_content_untruncatedShort content left untouched⭐

1.7 cache/update.rs (17)

Location: src/cache/update.rs within #[cfg(test)] module

Purpose: Cache update logic, differential update, MockGitHubClient

Test NamePurposeImportance
test_updater_newCacheUpdater initialization⭐⭐
test_save_and_load_cacheCache save/load⭐⭐⭐
test_load_cache_missing_fileHandling missing file⭐⭐⭐
test_save_cache_invalid_jsonDetecting invalid JSON⭐⭐
test_cache_metadataMetadata round-trip within the update flow⭐⭐
test_update_force_with_mockForce update (Mock)⭐⭐⭐
test_update_differential_with_mockDifferential update (Mock)⭐⭐⭐
test_update_with_no_changesHandling no updates⭐⭐
test_update_with_rate_limit_warningRate limit warning⭐⭐⭐
test_update_auth_failureAuthentication failure error⭐⭐⭐
test_update_with_gist_modification_deletes_cacheCache deletion upon Gist modification⭐⭐⭐
test_cache_updater_with_verboseVerbose mode⭐⭐
test_update_verbose_modeVerbose detailed logs⭐⭐
test_update_differential_with_existing_cache_verboseVerbose differential update⭐⭐
test_update_with_low_rate_limit_verboseVerbose low rate limit⭐⭐
test_update_gist_modification_verboseVerbose Gist update⭐⭐
test_update_force_verbose_without_existing_cacheVerbose new cache⭐⭐

Coverage: 62.24% (89/143 lines) — stale, see note above

Windows Support: ✅ Fully supported


1.8 execution/runner.rs (11)

Location: src/execution/runner.rs within #[cfg(test)] module

Purpose: Basic functionality of ScriptRunner (file selection, option settings)

Test NamePurposeImportance
test_runner_newScriptRunner initialization⭐⭐
test_run_optionsRunOptions settings⭐⭐
test_run_options_combinationsOption combinations⭐⭐
test_run_options_preview_modePreview mode⭐⭐
test_run_options_download_modeDownload mode⭐⭐
test_select_main_file_single_fileSingle file selection⭐⭐⭐
test_select_main_file_multiple_filesMultiple file selection⭐⭐⭐
test_select_main_file_by_interpreterInterpreter-specific selection⭐⭐⭐
test_select_main_file_with_explicit_filenameExplicit filename specification⭐⭐⭐
test_runner_with_different_interpretersBehavior of each interpreter⭐⭐
test_display_infoInformation display⭐

Coverage: 19.88% → 69.01% (improved by integration tests) — stale, see note above

Windows Support: ✅ Fully supported (excluding execution part)


1.9 execution/highlight.rs (6)

Location: src/execution/highlight.rs within #[cfg(test)] module

Purpose: Syntax highlighting for --preview output and the interactive picker’s preview pane

Test NamePurposeImportance
syntax_for_resolves_known_extensionsExtension → syntect syntax lookup⭐⭐⭐
syntax_for_falls_back_to_shebang_when_extension_unknownShebang-based syntax fallback⭐⭐⭐
syntax_for_does_not_touch_disk_for_nonexistent_filesNo filesystem access for a nonexistent path⭐⭐
highlight_content_wraps_output_in_reset_codeOutput is wrapped with an ANSI reset code⭐⭐
highlight_content_handles_empty_contentEmpty content edge case⭐
highlight_content_falls_back_for_unknown_extensionPlain-text fallback for unrecognized syntax⭐⭐

Coverage: Not measured (module added after the last coverage run — see note above)

Windows Support: ✅ Fully supported


1.10 github/api.rs (6, 1 active + 5 #[ignore])

Location: src/github/api.rs within #[cfg(test)] module

Purpose: Initialization of GitHubApi struct (execution tests are #[ignore])

Test NamePurposeImportance
test_api_structureBasic structure functionality⭐
test_check_auth_when_authenticated (#[ignore])gh authentication check⭐⭐⭐
test_get_user (#[ignore])Get username⭐⭐
test_check_rate_limit (#[ignore])Rate limit check⭐⭐
test_fetch_gists_without_since (#[ignore])Get all Gists⭐⭐⭐
test_fetch_gists_with_since (#[ignore])Get differential Gists⭐⭐⭐

Coverage: 8.33% (5/60 lines) — stale, see note above

Windows Support: ⚠️ Partial support (requires gh CLI)


1.11 github/client.rs (5)

Location: src/github/client.rs within #[cfg(test)] module

Purpose: MockGitHubClient operation verification

Test NamePurposeImportance
test_mock_check_auth_successMock authentication success⭐⭐
test_mock_get_userMock user retrieval⭐⭐
test_mock_check_rate_limitMock rate limit⭐⭐
test_mock_fetch_gistsMock Gist retrieval⭐⭐
test_mock_fetch_gist_contentMock content retrieval⭐⭐

Coverage: 100% (MockGitHubClient implementation) — stale, see note above

Windows Support: ✅ Fully supported


1.12 error.rs (4)

Location: src/error.rs within #[cfg(test)] module

Purpose: Error type conversion, display

Test NamePurposeImportance
test_error_displayError display⭐⭐
test_error_from_ioIO error conversion⭐⭐
test_error_from_jsonJSON error conversion⭐⭐
test_result_type_aliasResult type alias⭐

Coverage: 0% (Error types tested at runtime) — stale, see note above

Windows Support: ✅ Fully supported


2. Integration Tests (61)

2.1 tests/cli_tests.rs (33; 32 compiled on Windows)

Location: tests/cli_tests.rs

Purpose: Verification of command-line argument processing, subcommands, and shell completions via assert_cmd

Test NamePurposeImportance
test_cli_helpTop-level --help⭐⭐
test_cli_version--version⭐
test_invalid_commandUnknown subcommand error⭐⭐
test_update_without_authupdate without gh auth⭐⭐⭐
test_update_forceupdate --force⭐⭐⭐
test_update_verboseupdate --verbose⭐⭐
test_update_verbose_without_progressVerbose output without a progress bar (non-TTY)⭐⭐
test_update_with_progress_displayProgress bar display during update⭐⭐
test_run_without_cacherun before any cache exists⭐⭐⭐
test_run_without_queryrun with no query argument⭐⭐
test_run_with_preview_flagrun --preview⭐⭐⭐
test_run_with_filename_flagrun --filename⭐⭐⭐
test_run_with_description_flagrun --description⭐⭐⭐
test_run_with_id_flagrun --id⭐⭐⭐
test_cache_list_emptycache list with no cache⭐⭐
test_cache_list_json_formatcache list --json⭐⭐
test_cache_list_json_format_emptycache list --json with no cache⭐⭐
test_cache_sizecache size⭐⭐
test_cache_clear_with_no_inputcache clear confirmation prompt, declined⭐⭐
test_config_showconfig show⭐⭐
test_config_show_emptyconfig show with no config file⭐⭐
test_config_show_with_contentconfig show with existing values⭐⭐
test_config_set_getconfig set + config get round-trip⭐⭐⭐
test_config_resetconfig reset⭐⭐
test_completions_helpcompletions --help⭐
test_completions_invalid_shellUnsupported shell argument⭐⭐
test_completions_bashcompletions bash generates a script⭐⭐⭐
test_completions_bash_contains_commandsBash script lists subcommands⭐⭐
test_completions_bash_subcommand_completion_not_empty (#[cfg(unix)])Regression test for #77: sources the generated bash script and asserts run/cache/config/update each still return completion candidates. Does not compile on Windows⭐⭐⭐
test_completions_zshcompletions zsh generates a script⭐⭐
test_completions_zsh_contains_commandsZsh script lists subcommands⭐⭐
test_completions_fishcompletions fish generates a script⭐⭐
test_completions_powershellcompletions powershell generates a script⭐⭐

Windows Support: ✅ Fully supported except test_completions_bash_subcommand_completion_not_empty, which is Unix-only (see Testing Guide)


2.2 tests/integration_test.rs (16)

Location: tests/integration_test.rs

Purpose: Verification of actual interpreter execution

Dependencies: bash/python3/node/ruby/perl/php/deno/bun/ts-node on Unix; PowerShell on Windows

Test NamePurposefixtureImportance
test_execute_bash_script (Unix)Bash executionhello.sh⭐⭐⭐
test_execute_python_script (Unix)Python executionhello.py⭐⭐⭐
test_execute_node_script (Unix)Node.js executionhello.js⭐⭐
test_execute_ruby_script (Unix)Ruby executionhello.rb⭐⭐
test_execute_perl_script (Unix)Perl executionhello.pl⭐⭐
test_execute_php_script (Unix)PHP executionhello.php⭐⭐
test_execute_ts_node_script (Unix)ts-node executionhello.ts⭐⭐
test_execute_deno_script (Unix)Deno executionhello.ts⭐⭐
test_execute_bun_script (Unix)Bun executionhello.ts⭐⭐
test_execute_with_arguments (Unix)Argument passingargs_echo.sh⭐⭐⭐
test_execute_failing_script (Unix)Error detectionerror_exit.sh⭐⭐⭐
test_preview_mode_does_not_execute (Unix)Preview modehello.sh⭐⭐⭐
test_execute_powershell_script (Windows)PowerShell executionhello.ps1⭐⭐⭐
test_execute_powershell_with_arguments (Windows)Argument passinghello.ps1⭐⭐⭐
test_execute_powershell_preview_mode (Windows)Preview modehello.ps1⭐⭐⭐
test_execute_powershell_failing_script (Windows)Error detectionhello.ps1⭐⭐⭐

Contribution to Coverage: execution/runner.rs +30-40% — stale, see note above

Windows Support: ⚠️ Conditional — the 12 Unix tests are #[ignore]d on Windows (4 PowerShell tests run instead); the 4 PowerShell tests are #[ignore]d on Unix


2.3 tests/runner_test.rs (12)

Location: tests/runner_test.rs

Purpose: Detailed verification of ScriptRunner operations

Dependencies: bash on Unix; PowerShell on Windows

Test NamePurposefixtureImportance
test_download_mode_creates_file (Unix)Download featurehello.sh⭐⭐⭐
test_preview_with_download_mode (Unix)Preview + Downloadhello.sh⭐⭐
test_cache_creation_after_execution (Unix)Cache creationhello.sh⭐⭐⭐
test_multiple_files_gist (Unix)Multiple file selectionhello.sh⭐⭐⭐
test_force_file_based_execution (Unix)File-based executionhello.sh⭐⭐
test_script_with_empty_arguments (Unix)Empty argument handlinghello.sh⭐⭐
test_powershell_download_mode (Windows)Download featurehello.ps1⭐⭐⭐
test_powershell_preview_with_download (Windows)Preview + Downloadhello.ps1⭐⭐
test_powershell_cache_creation (Windows)Cache creationhello.ps1⭐⭐⭐
test_powershell_multiple_files_gist (Windows)Multiple file selectionhello.ps1⭐⭐⭐
test_powershell_force_file_based (Windows)File-based executionhello.ps1⭐⭐
test_powershell_with_empty_arguments (Windows)Empty argument handlinghello.ps1⭐⭐

Contribution to Coverage: execution/runner.rs +10-15% — stale, see note above

Windows Support: ⚠️ Conditional — the 6 Unix tests are #[ignore]d on Windows (6 PowerShell tests run instead); the 6 PowerShell tests are #[ignore]d on Unix


3. E2E Tests (26 Cases, Manual)

Note: The docs/tests/ directory referenced below was not found in the repository as of this update (2026-08-20). The case list and counts below are carried over unverified from the 2025-11-06 version of this document; treat them as aspirational/planned rather than confirmed to exist.

3.1 E2E Test Overview

What is E2E Testing?: Verification of complete user workflow by actually executing the binary from the command line

Reason for Not Implemented Yet: Lower priority than integration tests

Planned Implementation:

tests/e2e/
├── test_full_workflow.sh        # Complete flow of update → run
├── test_cache_management.sh     # cache list/size/clear
└── test_option_combinations.sh  # --force, --preview, --download

Expected Benefits:

  • Full assurance of user experience
  • Integration verification between modules
  • Automation of manual tests

Test Classification Summary

ClassificationNumber of TestsCoverage ContributionWindows SupportStatus
Unit Tests19057-60% (stale)✅ Full✅ Completed
Integration Tests61+10-11% (stale)⚠️ Conditional✅ Completed
E2E Tests26 cases+2-3% (stale)⚠️ Conditional📝 Unverified (see note in §3)
Total27768.95% (stale)--

Test Importance Criteria

MarkMeaningDescription
⭐⭐⭐EssentialDirectly leads to data loss or critical bugs
⭐⭐RecommendedAffects user experience or major features
⭐OptionalEdge cases or rare situations

Coverage Contribution

Figures in this section are carried over from 2025-11-06 and have not been re-measured (see note at the top of this document).

High Contribution (10% or more)

  • Integration Tests (tests/integration_test.rs + runner_test.rs): +10.87%
    • Covers execution part of execution/runner.rs

Medium Contribution (5-10%)

  • cli.rs Unit Tests: Contributes approx. 5-6% to overall
  • search/query.rs Unit Tests: Contributes approx. 4-5% to overall

Low Contribution (1-5%)

  • Individual unit tests for each module

Test Implementation History

Phase 1-5 (Unit Tests): 120 (as of 2025-11-06)

  • cache/types.rs: 11
  • config.rs: 5
  • cache/content.rs: 18
  • cli.rs: 21
  • search/query.rs: 26
  • cache/update.rs: 16
  • execution/runner.rs: 10
  • github/client.rs: 5
  • error.rs: 4
  • Others: 4

Achieved Coverage: 57.31%

Phase 6 (Integration Tests): 12 (as of 2025-11-06)

  • tests/integration_test.rs: 6
  • tests/runner_test.rs: 6
  • tests/fixtures/: 5 files

Achieved Coverage: 68.18% (+10.87%)

Phase 7 (E2E): 26 Cases (Manual Execution, unverified — see note in §3)

Expected Coverage: 70-71% (+2-3%)

Phase 8 (Unit + Integration growth to 251, as of 2026-08-20)

Between 2025-11-06 and 2026-08-20 the suite grew from 153 to 251 automated tests, driven primarily by:

  • Interactive Gist picker (Closes #74, PR #75): added src/search/interactive.rs (36 tests) and src/execution/highlight.rs (6 tests)
  • cache clean command: added 7 tests to cache/content.rs and 3 to cli.rs
  • Extension-based interpreter configuration and detection: added tests across config.rs, cli.rs
  • Shell completions, config subcommands, PowerShell execution coverage: grew tests/cli_tests.rs from 15 to 33 and added PowerShell-specific variants across tests/integration_test.rs and tests/runner_test.rs
  • Bash completion subcommand-completion fix (PR #77): added 1 Unix-only regression test to tests/cli_tests.rs

Coverage percentages were not re-measured as part of this growth; see the note at the top of this document.


Last Updated: 2026-08-20 (test counts and test lists only) Coverage: 68.95% (533/773 lines) — stale, not re-measured