diff options
Diffstat (limited to 'test/bun.js/buffer.test.js')
-rw-r--r-- | test/bun.js/buffer.test.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/bun.js/buffer.test.js b/test/bun.js/buffer.test.js index a1a3d325a..cb6223cf0 100644 --- a/test/bun.js/buffer.test.js +++ b/test/bun.js/buffer.test.js @@ -90,6 +90,18 @@ it("Buffer.isBuffer", () => { gc(); expect(a instanceof Buffer).toBe(true); expect(a instanceof Uint8Array).toBe(true); + expect(new Uint8Array(0) instanceof Buffer).toBe(false); + + // DOMJIT + for (let i = 0; i < 9000; i++) { + if (!Buffer.isBuffer(a)) { + throw new Error("Buffer.isBuffer failed"); + } + + if (Buffer.isBuffer("wat")) { + throw new Error("Buffer.isBuffer failed"); + } + } }); it("writeInt", () => { @@ -430,7 +442,7 @@ it("read", () => { // this is for checking the simd code path it("write long utf16 string works", () => { - const long = "ππππππ
ππ€£βΊοΈπππ".repeat(1000); + const long = "ππππππ
ππ€£βΊοΈπππ".repeat(200); const buf = Buffer.alloc(long.length * 2); buf.write(long, 0, "utf16le"); expect(buf.toString("utf16le")).toBe(long); |