aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/unsafe.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'integration/bunjs-only-snippets/unsafe.test.js')
-rw-r--r--integration/bunjs-only-snippets/unsafe.test.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/unsafe.test.js b/integration/bunjs-only-snippets/unsafe.test.js
index 1ce0935d6..d47821f42 100644
--- a/integration/bunjs-only-snippets/unsafe.test.js
+++ b/integration/bunjs-only-snippets/unsafe.test.js
@@ -40,3 +40,11 @@ it("arrayBufferToString u16", () => {
expect(charCodes.length).toBe("hello world".length);
Bun.gc(true);
});
+
+it("Bun.allocUnsafe", () => {
+ var buffer = Bun.allocUnsafe(1024);
+ expect(buffer instanceof Uint8Array).toBe(true);
+ expect(buffer.length).toBe(1024);
+ buffer[0] = 0;
+ expect(buffer[0]).toBe(0);
+});