mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-18 13:30:48 +00:00
test: tighten hostname normalization coverage
This commit is contained in:
@@ -4,10 +4,12 @@ import { normalizeHostname } from "./hostname.js";
|
||||
describe("normalizeHostname", () => {
|
||||
it("trims, lowercases, and strips a trailing dot", () => {
|
||||
expect(normalizeHostname(" Example.COM. ")).toBe("example.com");
|
||||
expect(normalizeHostname(" ")).toBe("");
|
||||
});
|
||||
|
||||
it("unwraps bracketed ipv6 hosts after normalization", () => {
|
||||
expect(normalizeHostname(" [FD7A:115C:A1E0::1] ")).toBe("fd7a:115c:a1e0::1");
|
||||
expect(normalizeHostname(" [FD7A:115C:A1E0::1]. ")).toBe("fd7a:115c:a1e0::1");
|
||||
});
|
||||
|
||||
it("leaves non-fully-bracketed values otherwise unchanged", () => {
|
||||
|
||||
Reference in New Issue
Block a user