[Repo Assist] test: add coverage for SshTunnelCommandLine, ExecApprovalV2Result, and McpToolBridge gaps#245
Merged
shanselman merged 1 commit intomasterfrom May 1, 2026
Conversation
…ge coverage gaps - SshTunnelCommandLine: 7 new tests covering CanForwardBrowserProxyPort boundary values and BuildArguments whitespace trimming - ExecApprovalV2Result: test ToString() includes code and reason - McpToolBridge: test custom serverName/serverVersion via constructor; test that null arguments value is accepted (not just missing arguments) All tests pass (Shared + Tray). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 30, 2026
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.
🤖 This is an automated PR from Repo Assist.
Fills three small but meaningful coverage gaps in the Shared test suite:
1.
SshTunnelCommandLine— 8 new testsCanForwardBrowserProxyPorthad zero test coverage despite being a public API with a clear contract (ports must be in range 1–65533). Added a[Theory]with 6 boundary cases:truetruetruefalsefalsefalseWhitespace trimming in
BuildArgumentswas untested. The implementation trims user and host before regex validation, but no test verified that" scott "and" mac-mini.local "produce the expected output rather than throwingArgumentException.2.
ExecApprovalV2Result.ToString()— 1 new testThe
ToString()override formats as"{Code}: {Reason}"but was completely untested. The test verifies bothCodeandReasonappear in the output.3.
McpToolBridge— 2 new testsserverName/serverVersion: The constructor accepts these parameters but all existing tests used the defaults. A test with explicit values confirmsinitializereflects them inresult.serverInfo.arguments:"arguments": nullis a valid JSON-RPC value (distinct from omitting the field). The bridge'sargs.ValueKind == JsonValueKind.Nullbranch was exercised but not tested.Test Status
OpenClaw.Shared.TestsOpenClaw.Tray.Tests