test(platform): improve platform-value test coverage#3313
Conversation
Add 270 new integration tests targeting previously uncovered code paths across the platform-value crate. Tests cover: - Value type checks, integer conversions, broad coercion (lib.rs) - has_data_larger_than for all variant types - From/TryFrom implementations for various Rust types - Bytes conversions (Bytes20/32/36, Identifier, Array) - Float/text/bool/null/array/map accessor methods and error paths - Display formatting for all Value variants - PartialEq implementations (integers, strings, floats, bytes, refs) - equal_underlying_data cross-variant comparison - String encoding/decoding (Base58, Base64, Hex) - ValueMap trait methods (sort, get, insert, remove) - Inner value map operations (get/set/remove typed values) - Path-based value access and mutation - Index/IndexMut operator overloads - Pointer (RFC 6901) navigation and mutation - Patch operations (add, remove, replace, move, copy, test) - Merge patch (RFC 7396) - Diff generation - JSON converter (TryInto, From, validating conversions) - CBOR converter (TryInto, TryFrom, buffer serialization) - Serde roundtrip (to_value/from_value for various types) - Replace operations (integer type replacement, clean_recursive) - System bytes conversions (identifier, binary data, hash256) - BTreeMap extension helpers (all getter/removal methods) - Inner array push operation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.1-dev #3313 +/- ##
============================================
+ Coverage 70.72% 71.57% +0.84%
============================================
Files 3293 3293
Lines 265144 266000 +856
============================================
+ Hits 187514 190378 +2864
+ Misses 77630 75622 -2008
🚀 New features to boost your workflow:
|
Issue being fixed or feature implemented
Improve test coverage for the
platform-valuecrate (previously at ~39.8%).What was done?
Added 270 new integration tests in
packages/rs-platform-value/tests/coverage_tests.rstargeting previously uncovered code paths across the platform-value crate:is_integer,is_integer_can_fit_in_64_bits,as_integer,into_integer,to_integer,to_integer_broad_conversion(float/bool/text coercion),has_data_larger_thanfor all 20+ variant typesOption<Value>,char,&String,Vec<&str>,&[&str],BTreeMapvariants, fixed-size array map constructors,TryFrom<Value>forString/Vec<u8>/integer typesinto_bytes/to_bytes/to_binary_data/as_bytes_slicefrom Bytes20/32/36/Identifier/Arraynon_qualified_string_representationequal_underlying_datacross-variantValueMapHelpertrait methods including sort variants, get/insert/remove operations[]operator for map/array/non-container types, IndexMut, null-to-map promotiontake(), edge casesclean_recursiveBTreeValueMapHelper(20+ methods),EqualUnderlyingData,BTreeValueMapPathHelper,BTreeValueRemoveFromMapHelper,BTreeMutValueMapHelperHow Has This Been Tested?
cargo test -p platform-value --all-features-- all 364 tests pass (94 existing + 270 new)cargo fmt --package platform-value-- code is properly formattedBreaking Changes
None. This PR only adds tests.
Checklist: