Skip to content

Move non-Windows shell stub tests behind //go:build !windows constraint - #32

Merged
kriserickson merged 2 commits into
add-explainfrom
copilot/sub-pr-27-yet-again
Mar 1, 2026
Merged

kriserickson merged 2 commits into
add-explainfrom
copilot/sub-pr-27-yet-again

Conversation

Copilot AI commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

TestParentShellProcess_NonWindows and TestPreferredPowerShell_NonWindows were in the unguarded detect_test.go, causing them to compile and run on Windows where those functions have real (non-stub) implementations — making the assertions incorrect on that platform.

Changes

  • New internal/shell/detect_other_test.go (//go:build !windows): houses the two tests that assert stub behavior (parentShellProcess() == "", preferredPowerShell() == "powershell"), mirroring the existing detect_other.go / detect_windows.go split.
  • internal/shell/detect_test.go: removed the two relocated tests, leaving only truly cross-platform tests.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ild tag

Co-authored-by: kriserickson <325934+kriserickson@users.noreply.github.com>
Copilot AI changed the title [WIP] Update explain flag and command explanations based on feedback Move non-Windows shell stub tests behind //go:build !windows constraint Mar 1, 2026
@kriserickson
kriserickson marked this pull request as ready for review March 1, 2026 20:27
Copilot AI review requested due to automatic review settings March 1, 2026 20:27
@kriserickson
kriserickson merged commit 89eecf6 into add-explain Mar 1, 2026
@kriserickson
kriserickson deleted the copilot/sub-pr-27-yet-again branch March 1, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves non-Windows-only shell stub tests behind a //go:build !windows constraint so they don’t run on Windows where the underlying functions have real implementations.

Changes:

  • Removed two non-Windows stub-behavior tests from the cross-platform internal/shell/detect_test.go.
  • Added internal/shell/detect_other_test.go with //go:build !windows containing those stub-behavior assertions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/shell/detect_test.go Removes platform-specific assertions so the remaining tests are truly cross-platform.
internal/shell/detect_other_test.go Adds !windows-guarded tests validating non-Windows stub behavior, matching the existing detect_other.go split.

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

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.

3 participants