diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2022-10-30 18:13:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 13:13:46 -0400 |
commit | 207dd8d111303f02b92d632ca00c165a657bc9c2 (patch) | |
tree | 270cd208e28351fa6ce8265aa63e9b299a613ac6 /test_napi/arraybuffer_test.js | |
parent | 59ac110edd1f376bed7fa6bbdbe2ee09c266bf74 (diff) |
fix(napi): fix is_detached_arraybuffer (#16478)
Diffstat (limited to 'test_napi/arraybuffer_test.js')
-rw-r--r-- | test_napi/arraybuffer_test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test_napi/arraybuffer_test.js b/test_napi/arraybuffer_test.js new file mode 100644 index 000000000..577443e8b --- /dev/null +++ b/test_napi/arraybuffer_test.js @@ -0,0 +1,12 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +import { assertEquals, loadTestLibrary } from "./common.js"; + +const typedarray = loadTestLibrary(); + +Deno.test("napi arraybuffer detach", function () { + const buf = new ArrayBuffer(5); + assertEquals(buf.byteLength, 5); + typedarray.test_detached(buf); + assertEquals(buf.byteLength, 0); +}); |