From b3fa316c5e0f25e9cff1caac6d5c36d7cdf8939c Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 30 Mar 2022 18:57:34 -0700 Subject: Add test for Bun.hash that runs it with a Uint8Array --- integration/bunjs-only-snippets/hash.test.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'integration/bunjs-only-snippets/hash.test.js') diff --git a/integration/bunjs-only-snippets/hash.test.js b/integration/bunjs-only-snippets/hash.test.js index c907002cc..71ad5a229 100644 --- a/integration/bunjs-only-snippets/hash.test.js +++ b/integration/bunjs-only-snippets/hash.test.js @@ -3,26 +3,34 @@ import { it, expect } from "bun:test"; import path from "path"; it(`Bun.hash()`, () => { - console.log(Bun.hash("hello world")); + Bun.hash("hello world"); + Bun.hash(new TextEncoder().encode("hello world")); }); it(`Bun.hash.wyhash()`, () => { - console.log(Bun.hash.wyhash("hello world")); + Bun.hash.wyhash("hello world"); + Bun.hash.wyhash(new TextEncoder().encode("hello world")); }); it(`Bun.hash.adler32()`, () => { - console.log(Bun.hash.adler32("hello world")); + Bun.hash.adler32("hello world"); + Bun.hash.adler32(new TextEncoder().encode("hello world")); }); it(`Bun.hash.crc32()`, () => { - console.log(Bun.hash.crc32("hello world")); + Bun.hash.crc32("hello world"); + Bun.hash.crc32(new TextEncoder().encode("hello world")); }); it(`Bun.hash.cityHash32()`, () => { - console.log(Bun.hash.cityHash32("hello world")); + Bun.hash.cityHash32("hello world"); + Bun.hash.cityHash32(new TextEncoder().encode("hello world")); }); it(`Bun.hash.cityHash64()`, () => { - console.log(Bun.hash.cityHash64("hello world")); + Bun.hash.cityHash64("hello world"); + Bun.hash.cityHash64(new TextEncoder().encode("hello world")); }); it(`Bun.hash.murmur32v3()`, () => { - console.log(Bun.hash.murmur32v3("hello world")); + Bun.hash.murmur32v3("hello world"); + Bun.hash.murmur32v3(new TextEncoder().encode("hello world")); }); it(`Bun.hash.murmur64v2()`, () => { - console.log(Bun.hash.murmur64v2("hello world")); + Bun.hash.murmur64v2("hello world"); + Bun.hash.murmur64v2(new TextEncoder().encode("hello world")); }); -- cgit v1.2.3