File: test.js

package info (click to toggle)
node-jest 29.6.2~ds1%2B~cs73.45.28-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 33,020 kB
  • sloc: javascript: 21,648; makefile: 47; sh: 21
file content (17 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const test = require("ava")
const arrayUniq = require("array-uniq")
const unicodeChars = arrayUniq([...require("unicode-chars")(), ...require("emoji.json").map(({ char }) => char)])
const charRegex = require(".")()

// See: https://mathiasbynens.be/notes/javascript-unicode#poo-test
test("The Pile of Poo Test™", (t) => {
	t.deepEqual("Iñtërnâtiônàlizætiøn☃💩".match(charRegex), [
		"I", "ñ", "t", "ë", "r", "n", "â", "t", "i", "ô", "n", "à", "l", "i", "z", "æ", "t", "i", "ø", "n", "☃", "💩",
	])
})

unicodeChars.forEach((character) => {
	test(`Test "${character}"`, (t) => {
		t.deepEqual(character.match(charRegex), [character])
	})
})