Skip to content

Fix test semantic correctness#13

Merged
xu-chris merged 1 commit intomainfrom
fix/test-semantic-coverage
Jan 21, 2026
Merged

Fix test semantic correctness#13
xu-chris merged 1 commit intomainfrom
fix/test-semantic-coverage

Conversation

@xu-chris
Copy link
Copy Markdown
Owner

Summary

Fixes semantic issues in tests identified during code review:

  1. same_keys?/1 test - The original test for "list containing non-maps" only exercised the fallback clause, not the Enum.all? logic that checks is_map(map) inside the iteration.

  2. Objects.encode nested key_order - Added missing test for nested path-specific key ordering.

Changes

utils_test.exs

  • Split "returns false for list containing non-maps" into two specific tests:
    • "returns false for list starting with non-map" - exercises def same_keys?(_), do: false
    • "returns false for list with map followed by non-maps" - exercises the Enum.all? with is_map check

objects_test.exs

  • Added "uses nested path key_order for nested objects" - verifies Map.fetch(key_order, path) logic for nested objects

Test plan

  • All 545 tests pass
  • New tests exercise the previously untested code paths

🤖 Generated with Claude Code

- Fix same_keys? test to exercise correct code path
  - Split "list containing non-maps" into two cases:
    - List starting with non-map (exercises fallback clause)
    - List with map followed by non-maps (exercises Enum.all? logic)

- Add nested path key_order test for Objects.encode
  - Verifies path-specific key ordering for nested objects
  - Exercises the Map.fetch(key_order, path) logic

Addresses semantic quality issues found during code review.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 126c2cb4bbfb9d12c7904d51deb2e9b1ad6b6a99-PR-13

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 67.867%

Totals Coverage Status
Change from base Build c30cee1377182339783e60d9ac5fffe57bc31592: 0.0%
Covered Lines: 716
Relevant Lines: 1055

💛 - Coveralls

@xu-chris xu-chris merged commit 039bd55 into main Jan 21, 2026
17 of 18 checks passed
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.

2 participants