diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-06-13 21:26:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 21:26:28 +0200 |
commit | 92e7287f4a744cad1fbe46ba1ce84c2b479ce6ac (patch) | |
tree | d8ef78aed744bce754c671af331b3d01c5f32f93 /cli/tests/unit_node/buffer_test.ts | |
parent | 7e81d3c876bccd208a2e7b9c33f6fad4e3cf1b0f (diff) |
fix(node/buffer): make slice be the same as subarray (#19481)
Diffstat (limited to 'cli/tests/unit_node/buffer_test.ts')
-rw-r--r-- | cli/tests/unit_node/buffer_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/unit_node/buffer_test.ts b/cli/tests/unit_node/buffer_test.ts new file mode 100644 index 000000000..1d7571f6a --- /dev/null +++ b/cli/tests/unit_node/buffer_test.ts @@ -0,0 +1,12 @@ +// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +import { Buffer } from "node:buffer"; +import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; + +Deno.test({ + name: "[node/buffer] slice with infinity returns empty buffer", + fn() { + const buf = Buffer.from([1, 2, 3, 4, 5]); + assertEquals(buf.slice(Infinity).length, 0); + }, +}); |