test: increase test coverage by 16% across 3 crates#970
Open
Nuel-osas wants to merge 1 commit intoiotaledger:developfrom
Open
test: increase test coverage by 16% across 3 crates#970Nuel-osas wants to merge 1 commit intoiotaledger:developfrom
Nuel-osas wants to merge 1 commit intoiotaledger:developfrom
Conversation
Add comprehensive unit tests targeting meaningful logic across iota-sdk-types, iota-sdk-transaction-builder, and iota-sdk-graphql-client. Line coverage increases from 47.84% to 64.08% (+16.24%). Key areas tested: - ZkLogin claim verification, JWT header parsing, Bn254FieldElement encoding - Passkey authenticator validation and serialization roundtrips - MoveAuthenticator construction, address extraction, serialization - ULEB128 encoding and MoveArgCollection BCS serialization - TransactionBuilder API, gas configuration, and command generation - BigInt-to-u64 conversion with overflow/error handling - Gas station version parsing and comparison - Pagination utilities, error types, faucet types, stream helpers - MultisigCommittee is_valid() validation logic - Unresolved transaction types and error variants All 387 new tests are fully offline and self-contained.
3 tasks
Member
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 387 unit tests across 16 files in 3 crates, increasing line coverage from 47.84% to 64.08% (+16.24%).
Targets meaningful logic rather than trivial getters:
verify_extended_claim,JwtHeader::from_base64,ZkLoginInputs::new), passkey authenticator validation & serialization roundtrips, MoveAuthenticator construction/address extraction/serialization, MultisigCommitteeis_valid()validation, Bn254FieldElement encoding, event/object typessend_coins), ULEB128 encoding & MoveArgCollection BCS serialization, gas station version parsing, unresolved transaction types, error variantsTryFrom<BigInt> for u64conversion with overflow/error cases, pagination utilities (Page::map,into_parts), error type system, faucet types, stream helpersAll tests are fully offline and self-contained. See
TEST_COVERAGE.mdfor detailed breakdown.Closes #504
Test plan
cargo +nightly test -p iota-sdk-types --lib --all-features— 536 passed, 0 failedcargo +nightly test -p iota-sdk-transaction-builder --lib— 139 passed, 8 failed (pre-existing, require localnet)cargo +nightly test -p iota-sdk-graphql-client --lib— 75 passed, 32 failed (pre-existing, require GraphQL endpoint)cargo-llvm-cov: 47.84% → 64.08%