Skip to content

Commit 90eb54a

Browse files
committed
test(commands): document IPv6 normalizeEndpoint case as known-broken
Address review feedback from coderabbitai on pkg/commands/contract_helpers_test.go:61: the IPv6 test case pinned a malformed URL (https://2001:db8::1:6443 — no brackets, not URL-parseable). Keep the case but document it as a known-bug pin via FIXME(#155); when the fix lands the expected value becomes https://[2001:db8::1]:6443 and the test starts asserting the canonical bracketed form. Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 2de2847 commit 90eb54a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎pkg/commands/contract_helpers_test.go‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ func TestContract_NormalizeEndpoint(t *testing.T) {
4747
{"http://1.2.3.4", "https://1.2.3.4:6443"},
4848
{"https://node.example.com:6443", "https://node.example.com:6443"},
4949
{"node.example.com", "https://node.example.com:6443"},
50-
// IPv6 with brackets — net.SplitHostPort returns the bracket-stripped host.
50+
// IPv6 with brackets — net.SplitHostPort returns the bracket-
51+
// stripped host, and the current normalizeEndpoint does NOT
52+
// re-add them, producing a malformed URL. Pinning the broken
53+
// output deliberately so a later fix surfaces here. Tracked
54+
// in issue #155 — when normalizeEndpoint switches to
55+
// net.JoinHostPort, the expected value below becomes
56+
// "https://[2001:db8::1]:6443" and the test starts asserting
57+
// the canonical form.
58+
// FIXME(#155): expected URL is malformed (missing brackets).
5159
{"[2001:db8::1]:6443", "https://2001:db8::1:6443"},
5260
}
5361
for _, tc := range cases {

0 commit comments

Comments
 (0)