mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 09:10:23 +00:00
test: tighten shared message and ipv4 coverage
This commit is contained in:
@@ -7,13 +7,18 @@ describe("shared/net/ipv4", () => {
|
||||
"IP address is required for custom bind mode",
|
||||
);
|
||||
expect(validateDottedDecimalIPv4Input("")).toBe("IP address is required for custom bind mode");
|
||||
expect(validateDottedDecimalIPv4Input(" ")).toBe(
|
||||
"Invalid IPv4 address (e.g., 192.168.1.100)",
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts canonical dotted-decimal ipv4 only", () => {
|
||||
expect(validateDottedDecimalIPv4Input("192.168.1.100")).toBeUndefined();
|
||||
expect(validateDottedDecimalIPv4Input(" 192.168.1.100 ")).toBeUndefined();
|
||||
expect(validateDottedDecimalIPv4Input("0177.0.0.1")).toBe(
|
||||
"Invalid IPv4 address (e.g., 192.168.1.100)",
|
||||
);
|
||||
expect(validateDottedDecimalIPv4Input("[192.168.1.100]")).toBeUndefined();
|
||||
expect(validateDottedDecimalIPv4Input("example.com")).toBe(
|
||||
"Invalid IPv4 address (e.g., 192.168.1.100)",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user