Skip to content

🧪 Add tests for Shell::from_path#27

Merged
bashandbone merged 1 commit intomainfrom
test-shell-from-path-2450735061863755547
Mar 14, 2026
Merged

🧪 Add tests for Shell::from_path#27
bashandbone merged 1 commit intomainfrom
test-shell-from-path-2450735061863755547

Conversation

@bashandbone
Copy link
Owner

🎯 What: The testing gap addressed
The Shell::from_path (and Shell::parse_shell_from_path) function in src/shells.rs was missing unit tests, leaving its behavior mapping executable paths to enum variants untested.

📊 Coverage: What scenarios are now tested

  • Supported shells (bash, zsh, fish, powershell/pwsh, elvish, nu/nushell) with and without path components and extensions (.exe).
  • Unrecognized shells (sh, cmd.exe, python, etc.) yielding None.
  • Edge cases like empty strings, root paths (/), current dir (.), parent dir (..), and dotfiles (.bash) yielding None.

Result: The improvement in test coverage
src/shells.rs now has a comprehensive test suite for its primary parsing function, ensuring regressions aren't introduced when modifying shell support or path parsing logic.


PR created automatically by Jules for task 2450735061863755547 started by @bashandbone

Added a test module in `src/shells.rs` containing tests for `Shell::from_path`.
The tests cover various common shell executable paths, aliases, extensions,
as well as unknown shells and invalid/empty paths.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 14, 2026 00:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a focused unit test suite for Shell::from_path in src/shells.rs, improving confidence that executable-path parsing continues to map to the correct Shell variants as shell support evolves.

Changes:

  • Added unit tests covering recognized shell executable names (with/without directories and .exe extensions).
  • Added unit tests ensuring unknown/invalid/edge-case paths return None.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bashandbone bashandbone merged commit 184da00 into main Mar 14, 2026
9 of 11 checks passed
@bashandbone bashandbone deleted the test-shell-from-path-2450735061863755547 branch March 14, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants