MCPcopy
hub / github.com/webpack/webpack / unicodeTest

Function unicodeTest

test/WasmHashes.unittest.js:139–154  ·  view source on GitHub ↗
(name, codePoints)

Source from the content-addressed store, hash-verified

137 * @param {string | number[]} codePoints code points
138 */
139 const unicodeTest = (name, codePoints) => {
140 it(`${name} should hash unicode chars correctly`, async () => {
141 const hash = createHash();
142 const reference = await createReferenceHash();
143 const str =
144 typeof codePoints === "string"
145 ? codePoints
146 : String.fromCodePoint(...codePoints);
147 hash.update(str);
148 reference.update(str);
149 const result = hash.digest("hex");
150 expect(result).toMatch(regExp);
151 const expected = reference.digest("hex");
152 expect(result).toBe(expected);
153 });
154 };
155
156 /**
157 * @param {string} name name

Callers 2

unicodeRangeTestFunction · 0.85

Calls 4

createHashFunction · 0.85
itFunction · 0.50
updateMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected