feat: expand integration test coverage for edge cases#58
Merged
Conversation
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>
There was a problem hiding this comment.
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.rswith 8 new integration tests using the existingShellTestharness. - Adds coverage for
cderror 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #15.
Adds
tests/edge_cases.rswith 8 integration tests using theShellTestharness covering:cdto a nonexistent directory — asserts stderr contains "no such file" or "not found"cdto a file (not a directory) — asserts stderr contains "not a directory"exit 42— assertsexit_code() == 42type echo— asserts output contains "echo" and "builtin"type sh(Unix) /type cmd(Windows) — asserts output contains<name> isand a path separatorechocommands — asserts both outputs appearType of change
Test checklist
cargo testpassescargo clippy --all-targets --all-features -- -D warningspassestests/edge_cases.rs