Skip to content

More testing#137

Merged
kruton merged 3 commits into
mainfrom
more-testing
May 7, 2026
Merged

More testing#137
kruton merged 3 commits into
mainfrom
more-testing

Conversation

@kruton
Copy link
Copy Markdown
Member

@kruton kruton commented May 7, 2026

No description provided.

kruton added 2 commits May 6, 2026 06:31
Extract some private functions to internal to allow unit testing.
Copilot AI review requested due to automatic review settings May 7, 2026 01:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and SignedDataComponents.
  • 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.

Comment thread sshlib/src/main/kotlin/org/connectbot/sshlib/client/AgentProtocolHandler.kt Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kruton kruton enabled auto-merge (rebase) May 7, 2026 02:05
@kruton kruton merged commit ed5719e into main May 7, 2026
10 checks passed
@kruton kruton deleted the more-testing branch May 7, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants