mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
Unit Test Utils: iconHashToBigInt iconBigIntToHash
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import "./local/snowflake.ts";
|
||||
import "./util/validateLength.ts";
|
||||
import "./util/hasProperty.ts";
|
||||
import "./util/hash.ts";
|
||||
|
||||
30
tests/util/hash.ts
Normal file
30
tests/util/hash.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { iconHashToBigInt, iconBigintToHash } from "../../src/util/hash.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
const iconHash = "4bbb271a13f7195031adcc06a2d867ce";
|
||||
const iconBigInt = 3843769888406823508519992434416504301518n;
|
||||
const a_iconHash = "a_4bbb271a13f7195031adcc06a2d867ce";
|
||||
const a_iconBigInt = 3503487521485885045056617826984736090062n;
|
||||
Deno.test({
|
||||
name: "[utils] icon hash to bigint",
|
||||
fn() {
|
||||
assertEquals(iconHashToBigInt(iconHash), iconBigInt);
|
||||
},
|
||||
});
|
||||
Deno.test({
|
||||
name: "[utils] icon bigint to hash",
|
||||
fn() {
|
||||
assertEquals(iconBigintToHash(iconBigInt), iconHash);
|
||||
},
|
||||
});
|
||||
Deno.test({
|
||||
name: "[utils] icon hash to bigint a_ (animated)",
|
||||
fn() {
|
||||
assertEquals(iconHashToBigInt(a_iconHash), a_iconBigInt);
|
||||
},
|
||||
});
|
||||
Deno.test({
|
||||
name: "[utils] icon bigint to hash a_ (animated)",
|
||||
fn() {
|
||||
assertEquals(iconBigintToHash(a_iconBigInt), a_iconHash);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user