summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit/kv_test.ts26
1 files changed, 19 insertions, 7 deletions
diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts
index 5a202fb0b..3a3476857 100644
--- a/cli/tests/unit/kv_test.ts
+++ b/cli/tests/unit/kv_test.ts
@@ -578,17 +578,29 @@ Deno.test("KvU64 underflow", () => {
}, RangeError);
});
-Deno.test("KvU64 frozen", () => {
+Deno.test("KvU64 unbox", () => {
const a = new Deno.KvU64(1n);
- assertThrows(() => {
- // @ts-expect-error value is readonly
- a.value = 2n;
- }, TypeError);
+ assertEquals(a.value, 1n);
});
-Deno.test("KvU64 unbox", () => {
+Deno.test("KvU64 unbox with valueOf", () => {
const a = new Deno.KvU64(1n);
- assertEquals(a.value, 1n);
+ assertEquals(a.valueOf(), 1n);
+});
+
+Deno.test("KvU64 auto-unbox", () => {
+ const a = new Deno.KvU64(1n);
+ assertEquals(a as unknown as bigint + 1n, 2n);
+});
+
+Deno.test("KvU64 toString", () => {
+ const a = new Deno.KvU64(1n);
+ assertEquals(a.toString(), "1");
+});
+
+Deno.test("KvU64 inspect", () => {
+ const a = new Deno.KvU64(1n);
+ assertEquals(Deno.inspect(a), "[Deno.KvU64: 1n]");
});
async function collect<T>(