Add edge case tests for diff function#4
Merged
Conversation
Test both-empty, one-empty (both directions), single-element same/different, completely disjoint arrays, and prefix/suffix relationships.
There was a problem hiding this comment.
Build & Tests
Build: pass. All 13 tests pass locally (carp -x tests/diff.carp) and in CI (macos + ubuntu green).
Findings
None. The 10 new edge case tests are well-chosen and correct:
- Empty-vs-empty, empty-vs-nonempty (both directions) — covers base cases the original 3 tests didn't touch
- Single-element same/different — good boundary
- Completely disjoint arrays — exercises the "no common subsequence" path
- Prefix/suffix relationships (4 variants) — good structural coverage
Minor note: no test for repeated elements (e.g. diff &[1 1 1] &[1 1]), but this is a small gap, not a blocker.
Verdict: merge
Clean test-only PR that meaningfully improves coverage. No code changes, no regressions.
hellerve
approved these changes
Jun 2, 2026
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.
Summary
carp -x tests/diff.carpTest plan
carp -x tests/diff.carp— 13/13 passedcarp-fmt -c— cleanangler— clean🤖 Generated with Claude Code