mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 07:20:08 +00:00
21 lines
609 B
TypeScript
21 lines
609 B
TypeScript
import { bigintToSnowflake, snowflakeToBigint } from "../../util/bigint.ts";
|
|
import { assertEquals, assertNotEquals } from "../deps.ts";
|
|
|
|
Deno.test("[Local Test] - snowflakeToBigint ", () => {
|
|
const text = "130136895395987456";
|
|
const big = 130136895395987456n;
|
|
const result = snowflakeToBigint(text);
|
|
|
|
assertEquals(big, result);
|
|
assertNotEquals(text, result);
|
|
});
|
|
|
|
Deno.test("[Local Test] - bigIntToSnowflake", () => {
|
|
const text = "130136895395987456";
|
|
const big = 130136895395987456n;
|
|
const result = bigintToSnowflake(big);
|
|
|
|
assertEquals(text, result);
|
|
assertNotEquals(big, result);
|
|
});
|