Skip to content

Commit

Permalink
test(cbor): number precision error in decoding test (denoland#6115)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackAsLight authored Oct 15, 2024
1 parent 3927872 commit bcc2c6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cbor/decode_cbor_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Deno.test("decodeCbor() decoding integers", () => {
assertEquals(decodeCbor(encodeCbor(num)), num);
assertEquals(decodeCbor(encodeCbor(BigInt(num))), num);

num = random(2 ** 32, 2 ** 64);
num = random(2 ** 32, Number.MAX_SAFE_INTEGER);
assertEquals(decodeCbor(encodeCbor(num)), BigInt(num));
assertEquals(decodeCbor(encodeCbor(BigInt(num))), BigInt(num));

Expand All @@ -59,7 +59,7 @@ Deno.test("decodeCbor() decoding integers", () => {
assertEquals(decodeCbor(encodeCbor(num)), num);
assertEquals(decodeCbor(encodeCbor(BigInt(num))), num);

num = -random(2 ** 32, 2 ** 64);
num = -random(2 ** 32, Number.MAX_SAFE_INTEGER);
assertEquals(decodeCbor(encodeCbor(num)), BigInt(num));
assertEquals(decodeCbor(encodeCbor(BigInt(num))), BigInt(num));
});
Expand Down

0 comments on commit bcc2c6b

Please sign in to comment.