feat(core-ts): detect() and validate() unit test suites (#189)#200
Merged
codeZe-us merged 1 commit intoBoxkit-Labs:mainfrom Mar 29, 2026
Merged
Conversation
…abs#189) Adds packages/core-ts/src/test/detect.test.ts and validate.test.ts with comprehensive coverage of the address detection and validation utilities. detect() tests cover: - Valid G / M / C addresses returning the correct kind - Case-insensitive normalisation (lowercase and mixed-case inputs) - Corrupted checksum detection returning "invalid" - Structural failures: empty, whitespace, truncated, too-long, all-A strings - Wrong-prefix rejection (S-keys, unknown prefixes) - Statelessness regression (interleaved calls return consistent results) validate() tests cover: - No-kind overload: any valid address returns true - Kind-match: each kind correctly returns true for itself - Kind-mismatch: every (address, wrong-kind) pair returns false - Invalid inputs: corrupted checksums, truncated, whitespace, secret keys - Case insensitivity for G and M addresses Closes Boxkit-Labs#189
|
@jerrymusaga Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
packages/core-ts/src/test/detect.test.ts— 20 assertions across 5 describe blockspackages/core-ts/src/test/validate.test.ts— 25 assertions across 5 describe blocksaddress/detect.tsandaddress/validate.tsutilities directly, extending beyond the minimal coverage insrc/spec/detect() coverage
validate() coverage
Test plan
pnpm --filter stellar-address-kit testpasses greentsc --noEmitreports zero errors on both filesCloses #189