More testing#137
Merged
Merged
Conversation
Extract some private functions to internal to allow unit testing.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands unit test coverage in sshlib and refactors a few previously-private helpers into reusable internal utilities to enable more direct testing of encoding/constraint logic.
Changes:
- Add EqualsVerifier-based equals/hashCode tests for
AuthPublicKey,BindingEntry, andSignedDataComponents. - Add focused tests for extracting the algorithm name from an SSH public key blob, and move that logic into an internal helper.
- Refactor agent helper logic (
buildAgentMessage, destination-constraint evaluation, and related value types) into internal top-level declarations and add boundary/roundtrip tests for message length encoding.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sshlib/src/test/kotlin/org/connectbot/sshlib/SshClientTest.kt | Adds equals/hashCode verification for AuthPublicKey. |
| sshlib/src/test/kotlin/org/connectbot/sshlib/client/KeyBlobAlgorithmNameTest.kt | New tests for keyBlobAlgorithmName covering boundaries and real key blobs. |
| sshlib/src/test/kotlin/org/connectbot/sshlib/AgentProtocolTest.kt | Adds new test classes for agent message building, constraint satisfaction, and equals/hashCode. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/client/SshConnection.kt | Extracts keyBlobAlgorithmName into an internal top-level helper using Kaitai stream reads. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/client/AgentProtocolHandler.kt | Refactors agent helper types/functions to top-level internals and updates constraint checking callsite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.