test: cover remaining branches in cbor_structurally_equal#410
Merged
Conversation
Six new test cases targeting the paths not reached by the original suite: - Indefinite bytestring/string: same chunk count, different content (exercises the return-false path inside the chunk-comparison loop) - Arrays/maps of different sizes (exercises the size-mismatch early-return) - Tag with both tagged items NULL (returns true) - Tag with one NULL and one non-NULL tagged item (returns false) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #410 +/- ##
==========================================
+ Coverage 99.59% 99.94% +0.34%
==========================================
Files 20 20
Lines 1737 1740 +3
==========================================
+ Hits 1730 1739 +9
+ Misses 7 1 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Adds 6 test cases to
test/structurally_equal_test.cto cover the branches incbor_structurally_equalthat were missed in #408, as identified by the codecov report at https://app.codecov.io/gh/PJK/libcbor/commit/dd5676a5971eaff9d8cf1f737c9844db0a5a1e05.return false(same chunk count, unequal content)test_bytestring_indefinite_unequal_chunksreturn false(same chunk count, unequal content)test_string_indefinite_unequal_chunkstest_array_different_sizetest_map_different_sizereturn truetest_tag_both_null_itemreturn falsetest_tag_one_null_itemNo production code changes.
Test plan
ctest -R structurally_equal_testpasses (42/42)cbor_structurally_equal🤖 Generated with Claude Code