Skip to content

Add edge case tests for diff function#4

Merged
hellerve merged 1 commit into
masterfrom
claude/edge-case-tests
Jun 2, 2026
Merged

Add edge case tests for diff function#4
hellerve merged 1 commit into
masterfrom
claude/edge-case-tests

Conversation

@carpentry-agent
Copy link
Copy Markdown

Summary

  • Add 10 edge case tests covering: both arrays empty, one array empty (both directions), single-element same/different, completely disjoint arrays, prefix/suffix relationships
  • All 13 tests (3 existing + 10 new) pass with carp -x tests/diff.carp

Test plan

  • carp -x tests/diff.carp — 13/13 passed
  • carp-fmt -c — clean
  • angler — clean

🤖 Generated with Claude Code

Test both-empty, one-empty (both directions), single-element
same/different, completely disjoint arrays, and prefix/suffix
relationships.
Copy link
Copy Markdown

@carpentry-reviewer carpentry-reviewer Bot left a comment

Choose a reason for hiding this comment

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

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 hellerve merged commit 3a7065a into master Jun 2, 2026
2 checks passed
@hellerve hellerve deleted the claude/edge-case-tests branch June 2, 2026 10:53
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.

1 participant