Skip to content

feat: expand integration test coverage for edge cases#58

Merged
cdprice02 merged 2 commits intomainfrom
feat/issue-15-integration-tests
Apr 8, 2026
Merged

feat: expand integration test coverage for edge cases#58
cdprice02 merged 2 commits intomainfrom
feat/issue-15-integration-tests

Conversation

@cdprice02
Copy link
Copy Markdown
Owner

Description

Closes #15.

Adds tests/edge_cases.rs with 8 integration tests using the ShellTest harness covering:

  • cd to a nonexistent directory — asserts stderr contains "no such file" or "not found"
  • cd to a file (not a directory) — asserts stderr contains "not a directory"
  • exit 42 — asserts exit_code() == 42
  • type echo — asserts output contains "echo" and "builtin"
  • type sh (Unix) / type cmd (Windows) — asserts output contains <name> is and a path separator
  • Multiple sequential echo commands — asserts both outputs appear
  • Whitespace-only input lines — asserts no errors and shell continues
  • Empty script — asserts no errors

Type of change

  • New feature (test coverage)

Test checklist

  • cargo test passes
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • New tests added in tests/edge_cases.rs

Closes #15. Adds tests/edge_cases.rs with 8 integration tests covering
cd-to-nonexistent-dir, cd-to-file, exit 42 propagation, type builtin,
type PATH executable, multiple sequential commands, whitespace-only lines,
and empty script — all using the ShellTest harness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 8, 2026 01:41
Copy link
Copy Markdown

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 new integration test module to broaden ShellTest-based coverage around common “edge case” behaviors (filesystem errors, exit codes, type output, and session/input handling), aligning with issue #15’s request for expanded integration coverage.

Changes:

  • Introduces tests/edge_cases.rs with 8 new integration tests using the existing ShellTest harness.
  • Adds coverage for cd error cases, exit 42, type (builtin + PATH executable), sequential commands, and empty/whitespace-only input handling.

…ions

Remove tests that duplicate existing builtin.rs/repl.rs coverage (cd
nonexistent, cd to file, exit 42, type system executable, sequential
echo, empty script). Keep only the two genuinely novel scenarios:
- type echo as a builtin (not covered by existing type exit test)
- whitespace-only lines with spaces+tabs mix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cdprice02 cdprice02 merged commit af7a46b into main Apr 8, 2026
8 checks passed
@cdprice02 cdprice02 deleted the feat/issue-15-integration-tests branch April 8, 2026 01:50
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.

Expand integration test coverage

2 participants