gist-cache-rs Functional Verification Test Design Document (Test Set 4: Preview Function Verification)
Test Objective
To confirm that the gist-cache-rs preview function (-p/--preview) works correctly.
Target Functionality
- Preview display with Auto Search
- Preview display with Direct ID Specification
- Preview display with Filename Search
- Preview display with existing cache
--previewoption (long option) behavior
Prerequisites
- gist-cache-rs is installed
- GitHub CLI is authenticated
- Metadata cache is up-to-date (
gist-cache-rs updatehas been executed) - Test Gists for hello_args series exist
Test Case List
TC1: Preview with Auto Search (-p option)
Objective: Confirm that preview is displayed correctly with keyword search.
Prerequisites:
- Searching for “hello” hits multiple Gists.
Steps:
- Search with
-poption:gist-cache-rs run -p hello bash - Select one from multiple candidates (e.g., number 7).
- Check displayed content.
Expected Result:
- Multiple Gists are displayed in a numbered list.
- After selecting a number, the following are displayed:
- Description
- Files
=== Gist Content ===section--- Filename ---header- File content (source code)
- Script is not executed (no version information or argument display).
Verification Items:
- Preview mode launches correctly.
- Gist content is displayed correctly.
- Exits without executing.
TC2: Preview with Direct ID Specification
Objective: Confirm that preview is displayed correctly when specifying ID.
Prerequisites:
- hello_args.sh (ID: 7bcb324e9291fa350334df8efb7f0deb) is known.
Steps:
- Preview with ID:
gist-cache-rs run -p --id 7bcb324e9291fa350334df8efb7f0deb bash - Check displayed content.
Expected Result:
- “ID specification mode” message is displayed.
- Search process is skipped.
- Description, Files, Gist content are displayed.
- Script is not executed.
Verification Items:
- Combination of direct ID specification and preview mode works.
- Selection UI is skipped.
- Content is displayed correctly.
TC3: Preview with Filename Specification
Objective: Confirm that preview is displayed correctly with filename search.
Prerequisites:
- hello_args.py exists.
Steps:
- Preview with filename:
gist-cache-rs run -p --filename hello_args.py python3 - Check displayed content.
Expected Result:
- Gist containing hello_args.py is searched.
- If single result, direct preview display.
- If multiple results, selection UI is displayed.
- Gist content is displayed correctly.
- Script is not executed.
Verification Items:
- Combination of filename search and preview mode works.
- Content is displayed correctly.
TC4: Preview with Cache
Objective: Confirm preview behavior when content cache exists.
Prerequisites:
- hello_args.sh is already cached (executed previously).
Steps:
- Verify cache:
ls ~/.cache/gist-cache/contents/7bcb324e9291fa350334df8efb7f0deb/ - Execute preview:
gist-cache-rs run -p --id 7bcb324e9291fa350334df8efb7f0deb bash - Check displayed content.
Expected Result:
- “Info: Cache not found…” message is not displayed.
- Content is loaded quickly from cache.
- Gist content is displayed correctly.
- Script is not executed.
Verification Items:
- Preview display from cache works.
- No network access occurs (if cache already exists).
TC5: --preview Option (Long Option)
Objective: Confirm that the long option --preview works correctly.
Prerequisites:
- hello_args.rb exists.
Steps:
- Search with
--previewoption:gist-cache-rs run --preview --filename hello_args.rb ruby - Check displayed content.
Expected Result:
- Behaves the same as
-p. - Gist content is displayed correctly.
- Script is not executed.
Verification Items:
- Long option
--previewworks. - Consistent behavior with
-p.
Test Execution Order
- TC1: Preview with Auto Search (Interactive Test)
- TC2: Preview with Direct ID Specification
- TC3: Preview with Filename Specification
- TC4: Preview with Cache
- TC5: –preview Option (Long Option)
Notes
- TC1 requires interactive input.
- Scripts are not executed in preview mode.
- Messages vary depending on cache presence.
- TC4 creates cache after TC2 execution.
- Arguments (bash, python3, etc.) are not used in preview display (display only).