
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-BSR-vRXo.js";
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
import { assert } from "../assert-MZs1qjMx.js";
import "../lookup-q8DeFAjR.js";
import { test } from "../testing-Cqwzq9nj.js";
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
import "../assert_is_error-BPGph1Jx.js";

//#region src/runtime/url.test.ts
test("validatePublicUrl()", async () => {
	await assertRejects(() => validatePublicUrl("ftp://localhost"), UrlError);
	await assertRejects(() => validatePublicUrl("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="), UrlError);
	await assertRejects(() => validatePublicUrl("https://localhost"), UrlError);
	await assertRejects(() => validatePublicUrl("https://127.0.0.1"), UrlError);
	await assertRejects(() => validatePublicUrl("https://[::1]"), UrlError);
});
test("isValidPublicIPv4Address()", () => {
	assert(isValidPublicIPv4Address("8.8.8.8"));
	assertFalse(isValidPublicIPv4Address("192.168.1.1"));
	assertFalse(isValidPublicIPv4Address("127.0.0.1"));
	assertFalse(isValidPublicIPv4Address("10.0.0.1"));
	assertFalse(isValidPublicIPv4Address("127.16.0.1"));
	assertFalse(isValidPublicIPv4Address("169.254.0.1"));
});
test("isValidPublicIPv6Address()", () => {
	assert(isValidPublicIPv6Address("2001:db8::1"));
	assertFalse(isValidPublicIPv6Address("::1"));
	assertFalse(isValidPublicIPv6Address("fc00::1"));
	assertFalse(isValidPublicIPv6Address("fe80::1"));
	assertFalse(isValidPublicIPv6Address("ff00::1"));
	assertFalse(isValidPublicIPv6Address("::"));
});
test("expandIPv6Address()", () => {
	assertEquals(expandIPv6Address("::"), "0000:0000:0000:0000:0000:0000:0000:0000");
	assertEquals(expandIPv6Address("::1"), "0000:0000:0000:0000:0000:0000:0000:0001");
	assertEquals(expandIPv6Address("2001:db8::"), "2001:0db8:0000:0000:0000:0000:0000:0000");
	assertEquals(expandIPv6Address("2001:db8::1"), "2001:0db8:0000:0000:0000:0000:0000:0001");
});

//#endregion