2024-12-31 14:12:39 -05:00
|
|
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
2024-03-11 18:49:43 -04:00
|
|
|
|
|
|
|
import * as punycode from "node:punycode";
|
2024-07-25 01:30:28 -04:00
|
|
|
import { assertEquals } from "@std/assert";
|
2024-03-11 18:49:43 -04:00
|
|
|
|
|
|
|
Deno.test("regression #19214", () => {
|
2024-03-26 18:52:57 -04:00
|
|
|
const input = "个\uFFFD\uFFFD.hk";
|
2024-03-11 18:49:43 -04:00
|
|
|
|
|
|
|
assertEquals(punycode.toASCII(input), "xn--ciq6844ba.hk");
|
|
|
|
|
|
|
|
assertEquals(punycode.toUnicode("xn--ciq6844ba.hk"), input);
|
|
|
|
});
|
|
|
|
|
|
|
|
Deno.test("Decode empty input", () => {
|
|
|
|
assertEquals(punycode.decode(""), "");
|
|
|
|
});
|