summaryrefslogtreecommitdiff
path: root/tests/unit_node/punycode_test.ts
blob: f5f8c4f973eda4a911f333372b19912fcee43380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

import * as punycode from "node:punycode";
import { assertEquals } from "@std/assert/mod.ts";

Deno.test("regression #19214", () => {
  const input = "个��.hk";

  assertEquals(punycode.toASCII(input), "xn--ciq6844ba.hk");

  assertEquals(punycode.toUnicode("xn--ciq6844ba.hk"), input);
});

Deno.test("Decode empty input", () => {
  assertEquals(punycode.decode(""), "");
});