1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00
denoland-deno/tests/unit_node/punycode_test.ts
2024-07-25 15:30:28 +10:00

16 lines
457 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as punycode from "node:punycode";
import { assertEquals } from "@std/assert";
Deno.test("regression #19214", () => {
const input = "个\uFFFD\uFFFD.hk";
assertEquals(punycode.toASCII(input), "xn--ciq6844ba.hk");
assertEquals(punycode.toUnicode("xn--ciq6844ba.hk"), input);
});
Deno.test("Decode empty input", () => {
assertEquals(punycode.decode(""), "");
});