aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/buffer.test.js
diff options
context:
space:
mode:
authorGravatar Justin Whear <justin.whear@gmail.com> 2023-02-15 12:58:53 -0800
committerGravatar GitHub <noreply@github.com> 2023-02-15 12:58:53 -0800
commite67b4e73b57d152c4897acd66cf1347cbdf20444 (patch)
tree071f6d23e2ed29080cc121c242f30feea4783aaa /test/bun.js/buffer.test.js
parent95e727162bd4a73ab673cf76898ec22638cd306a (diff)
downloadbun-e67b4e73b57d152c4897acd66cf1347cbdf20444.tar.gz
bun-e67b4e73b57d152c4897acd66cf1347cbdf20444.tar.zst
bun-e67b4e73b57d152c4897acd66cf1347cbdf20444.zip
Fix 2063 (#2079)
Diffstat (limited to 'test/bun.js/buffer.test.js')
-rw-r--r--test/bun.js/buffer.test.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/bun.js/buffer.test.js b/test/bun.js/buffer.test.js
index f8704d040..0dcf96816 100644
--- a/test/bun.js/buffer.test.js
+++ b/test/bun.js/buffer.test.js
@@ -2550,3 +2550,11 @@ it("should not perform out-of-bound access on invalid UTF-8 byte sequence", () =
expect(str.length).toBe(6);
expect(str).toBe("\uFFFD\x13\x12\x11\x10\x09");
});
+
+it("repro #2063", () => {
+ const buf = Buffer.from("eyJlbWFpbCI6Ijg3MTg4NDYxN0BxcS5jb20iLCJpZCI6OCwicm9sZSI6Im5vcm1hbCIsImlhdCI6MTY3NjI4NDQyMSwiZXhwIjoxNjc2ODg5MjIxfQ", 'base64');
+ expect(buf.length).toBe(85);
+ expect(buf[82]).toBe(50);
+ expect(buf[83]).toBe(49);
+ expect(buf[84]).toBe(125);
+});